Class text interface: an instance of C and a vector of Attribute<C> More...

#include <TextInterfaceTo.h>

Inheritance diagram for TextInterface::To< C >:
TextInterface::Parser Reference::Able Reference::HeapTracked

Public Member Functions

virtual void set_instance (C *c)
 Set the instance.
void setup (const Value *value)
 Set the instance of the Attribute<C>
void add_value (Attribute< C > *value)
template<class P>
void i< parent-> size ()
 Import the attribute interfaces from a parent text interface.
if (!import_filter||!found(parent->get(i) ->get_name())) add_value(new IsAProxy< C
P (parent->get(i)))
template<class M, class G>
void i< member-> size ()
 Import the attribute interfaces from a member text interface.
if (!import_filter||!found(name, member->get(i) ->get_name())) add_value(new HasAProxy< C
G (name, member->get(i), get))
template<class E, class G, class S>
void i< member-> size ()
 Import the attribute interfaces from a vector element text interface.
 if (!value) continue
 if (!import_filter||!found(name, value->get_name())) add_value(new VectorOfProxy< C
 S (name, value, g, s))
template<class K, class E, class G>
void i< member-> size ()
 Import the attribute interfaces from a map data text interface.
if (!import_filter||!found(name, member->get(i) ->get_name())) add_value(new MapOfProxy< C
G (name, member->get(i), g))
template<class K, class E, class G>
void void void void void unsigned size () const
 Import the attribute interfaces from a parent text interface.
const Attribute< C > * get (unsigned i) const
 Provide access to the attributes.
Public Member Functions inherited from TextInterface::Parser
 Parser ()
 Default constructor.
 ~Parser ()
 Destructor.
std::string get_value (const std::string &name) const
 Get the named value.
std::string get_name_value (std::string &name) const
 Get the named value and update name for display purposes.
void set_value (const std::string &name, const std::string &value)
 Set the named value.
Valuefind (const std::string &name, bool throw_exception=true) const
 Find the named value.
bool found (const std::string &name) const
 Return true if the named value is found.
bool found (const std::string &prefix, const std::string &name) const
 Return true if prefix:name is found.
unsigned get_nvalue () const
 Get the number of values.
std::string get_name (unsigned) const
 Get the name of the value.
std::string get_value (unsigned) const
 Get the value.
std::string get_description (unsigned) const
 Get the description of the value.
virtual std::string process (const std::string &command)
 Process a command.
virtual std::string process (const std::vector< std::string > &commands)
 Process a vector of commands.
virtual std::string help (bool show_default_values=false, bool show_header=false, const char *indent=0)
 Return the list of available values.
virtual std::string get_interface_name () const
 Get the name of this interface.
virtual std::string get_interface_description () const
 Get a short description of this interface.
void set_indentation (const std::string &indent)
 Set the indentation that precedes the output of a call to process.
std::string get_indentation () const
void set_delimiter (const std::string &)
 Set the delimiter used to separate the elements of a container.
std::string get_delimiter () const
void set_prefix_name (bool flag)
 Prefix output with "name=".
void set_aliases (const Alias *alias)
 Set aliases for value names.
void insert (Parser *)
 Insert Parser into self.
void insert (const std::string &prefix, Parser *)
 Import a nested interface.
void clean ()
 Clear all nested interfaces.
Public Member Functions inherited from Reference::Able
 Able ()
 Default constructor.
 Able (const Able &)
 Copy constructor.
Ableoperator= (const Able &)
 Assignment operator.
virtual ~Able ()
 Destructor.
unsigned get_reference_count () const
 Returns the number of references there are to this.
Public Member Functions inherited from Reference::HeapTracked
 HeapTracked ()
 Default constructor.
 HeapTracked (const HeapTracked &)
 Copy constructor.
HeapTrackedoperator= (const HeapTracked &)
 Assignment operator.
virtual ~HeapTracked ()
 Destructor.
bool __is_on_heap () const
 Return true if this instance is found in heap addresses.

Public Attributes

M
 i
 E
 G
K
E

Protected Member Functions

template<class P, typename T>
void add (T(P::*get)() const, const char *name, const char *description=0)
 Factory generates a new AttributeGet instance.
template<class P, typename T, typename U>
void add (T(P::*get)() const, void(P::*set)(const U &), const char *name, const char *description=0)
 Factory generates a new AttributeGetSet instance with description.
template<class P, typename T, typename U>
void add (T(P::*get)() const, void(P::*set)(U), const char *name, const char *description=0)
 Factory generates a new AttributeGetSet instance with description.
template<class P, typename T, typename U>
void add (T(P::*get)() const, void(P::*set)(const U &), Parser *(P::*get_parser)(), const char *name, const char *description=0)
 Factory generates a new DirectInterface instance with description.
template<class P, typename T, typename U>
void add (T(P::*get)() const, void(P::*set)(U), Parser *(P::*get_parser)(), const char *name, const char *description=0)
 Factory generates a new DirectInterface instance with description.
template<class P, typename U, typename Parent>
void add (U *(P::*get)() const, void(P::*set)(U *), Parser *(Parent::*get_parser)(), const char *name, const char *description=0)
 Factory generates a new IndirectInterface instance with description.
template<class Get, class Set, class Parser>
void add (Get get, Set set, Parser parser, const char *name, const char *description=0)
 Factory generates a new DirectInterface instance with description.
template<class Get>
void add (Get get, const char *name, const char *description=0)
 Add adaptable unary function object template.
template<class Get, class Set>
void add (Get get, Set set, const char *name, const char *description=0)
 Add adaptable unary function object template.
Protected Member Functions inherited from TextInterface::Parser
void add_value (Value *value)
 Add a new value interface.
void remove (const std::string &name)
 Remove the named value interface.
void clean_invalid ()
 Clean up invalid references in values vector.
Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 Add the address of a reference to this object.
void __dereference (bool auto_delete=true) const
 Remove the address of a reference to this object.

Protected Attributes

Reference::To< C, false > instance
 The instance of the class with which this interfaces.
Protected Attributes inherited from TextInterface::Parser
std::string indentation
 The indentation that precedes the output of a call to process.
std::string delimiter
 The delimiter used to separate the elements of a container.
bool alphabetical
 Maintain alphabetical order of parameter names.
bool import_filter
 Filter duplicate value names during import.
bool prefix_name
 Prefix "name=" when retrieving a value.
Reference::To< const Aliasaliases
 The aliases for the value names.
std::vector< Reference::To< Value > > values
 The vector of values.
std::vector< Reference::To< Parser > > inserted
 Any inserted Parser is owned by this.

Additional Inherited Members

Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 Returns the current number instances in existence.
Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 Records the addresses of new instances allocated on the heap.
static void operator delete (void *location, void *ptr)
 Placement delete overload to match the placement new overload.
static void operator delete (void *location)
 Regular delete overload.
static size_t get_heap_queue_size ()
 Return the number of heap addresses awaiting processing.

Detailed Description

template<class C>
class TextInterface::To< C >

Class text interface: an instance of C and a vector of Attribute<C>

Member Function Documentation

◆ setup()

template<class C>
void TextInterface::To< C >::setup ( const Value * value)
inlinevirtual

Set the instance of the Attribute<C>

Reimplemented from TextInterface::Parser.

References TextInterface::Value::get_name(), TextInterface::Attribute< C >::instance, and instance.

Referenced by set_instance().

◆ size() [1/4]

template<class C>
template<class M, class G>
void i< member-> TextInterface::To< C >::size ( )

Import the attribute interfaces from a member text interface.

In this template, G should be of the type pointer to member function of C that returns pointer to M

References get(), and TextInterface::Parser::import_filter.

◆ size() [2/4]

template<class C>
template<class E, class G, class S>
void i< member-> TextInterface::To< C >::size ( )

Import the attribute interfaces from a vector element text interface.

In this template: G should be of the type pointer to member function of C that returns pointer to the indexed element of type E, S should be a pointer to the member function that returns the number of elements of type E in C.

References TextInterface::Parser::found(), TextInterface::Value::get_name(), and TextInterface::Parser::import_filter.

◆ size() [3/4]

template<class C>
template<class K, class E, class G>
void i< member-> TextInterface::To< C >::size ( )

Import the attribute interfaces from a map data text interface.

In this template: G should be of the type pointer to member function of C that accepts key K and returns pointer to data element E.

References TextInterface::Parser::import_filter.

◆ size() [4/4]

template<class C>
template<class K, class E, class G>
void void void void void unsigned TextInterface::To< C >::size ( ) const
inline

Import the attribute interfaces from a parent text interface.

Import the attribute interfaces from a member text interface Import the attribute interfaces from a member text interface Return the number of attributes

References TextInterface::Parser::values.

Member Data Documentation

◆ i

template<class C>
TextInterface::To< C >::i
Initial value:
{
const Attribute<E>* value = member->get(i)
Text interface to a class attribute.
Definition TextInterfaceAttribute.h:23

The documentation for this class was generated from the following file:

Generated using doxygen 1.14.0