12#ifndef __TextInterfaceAdapter_h
13#define __TextInterfaceAdapter_h
15namespace TextInterface
20 template<
class IsA,
class HasA = IsA>
21 class AdapterBase :
public IsA
25 AdapterBase (HasA* _value = 0) {
value = _value; }
29 {
return value->get_name(); }
33 {
return value->get_description(); }
37 {
return value->get_detailed_description (); }
39 bool matches (
const std::string& name)
const
40 {
return value->matches (name); }
42 void set_parent (Parser* p)
43 { IsA::set_parent(p);
value->set_parent(p); }
45 void set_modifiers (
const std::string& mods)
const
46 {
value->set_modifiers (mods); }
48 void reset_modifiers ()
const
49 {
value->reset_modifiers(); }
59 template<
class IsA,
class HasA = IsA>
67 std::string get_value ()
const
68 {
return this->
value->get_value (); }
71 void set_value (
const std::string& val)
72 { this->
value->set_value (val); }
76 template<
class IsA,
class HasA = IsA>
78 :
public AdapterBase< Attribute<IsA>, Attribute<HasA> >
84 { this->
value->set_description (description); }
88 { this->
value->set_detailed_description (description); }
Template class manages Reference::Able objects.
Definition ReferenceTo.h:25
Base class of Value adapters.
Definition TextInterfaceAdapter.h:22
std::string get_detailed_description() const
Set the detailed description of the value.
Definition TextInterfaceAdapter.h:36
std::string get_description() const
Get the description of the value.
Definition TextInterfaceAdapter.h:32
Reference::To< HasA > value
The nested value.
Definition TextInterfaceAdapter.h:54
std::string get_name() const
Get the name of the value.
Definition TextInterfaceAdapter.h:28
Can be used as an Adapter (IsA != HasA) or a Decorator (IsA == HasA)
Definition TextInterfaceAdapter.h:79
void set_detailed_description(const std::string &description)
Set the detailed description of the attribute.
Definition TextInterfaceAdapter.h:87
void set_description(const std::string &description)
Set the description of the attribute.
Definition TextInterfaceAdapter.h:83