#include <idioskopos/propertybase.h>
Inheritance diagram for Idioskopos::PropertyBase< std::vector< X, A > >:
Public Types | |
typedef IdioskoposPointer< PropertyBase > | pointer |
typedef std::vector< X, A > | value_type |
typedef std::set< Object * > | Objects |
Public Member Functions | |
IDIOSKOPOS_OBJECT (PropertyBase) | |
PropertyBase (const Glib::ustring &name) | |
Default constructor that doesn't do much. | |
PropertyBase (const Glib::ustring &name, Introspectable &container) | |
Makes this a property of the introspectable container accessible through the provided name. | |
PropertyBase< std::vector< X, A > > & | operator= (const std::vector< X, A > &val) |
Allows assignment to the property from the contained value type. | |
PropertyBase< std::vector< X, A > > & | operator() (const std::vector< X, A > &val) |
Function call syntax. | |
virtual Glib::ustring | xml (int indent=-1) |
The get_xml function is a template method with full specializations for known types. | |
const std::type_info & | type () const |
Returns the RTTI type id of the contained type. | |
virtual size_t | num_properties () const |
If this is a property container, this should be reimplemented to provide a true count of the number of child properties this container has. | |
virtual Object::iterator | properties_begin () |
IDIOSKOPOS_OBJECT (ReadOnlyPropertyBase) | |
IDIOSKOPOS_OBJECT (Object) | |
virtual const std::vector< X, A > & | get () const=0 |
The canonical get() accessor method. | |
virtual std::vector< X, A > * | get_pointer ()=0 |
Should return a pointer to the contained object, or NULL if pointers are not allowed. | |
virtual const std::vector< X, A > * | get_pointer () const |
operator const std::vector () const | |
Allows for implicit casts to the contained type. | |
const std::vector< X, A > & | operator() () const |
Function call syntax. | |
std::vector< X, A > * | operator-> () |
A convenience operator when the property contains a class. | |
virtual Glib::ustring | value () |
Similar in concept to the xml() method, this provides a string representation of the contained value if the get_value() template has a meaningful template specialization. | |
const Glib::ustring & | name () |
void | set_name (const Glib::ustring &n) |
virtual sigc::signal< void, Object * > | signal_property_added () |
Returns the property added signal if this is an introspectable object, otherwise throws an exception. | |
virtual sigc::signal< void, Object * > | signal_property_removed () |
Returns the property removed signal if this is an introspectable object, otherwise throws an exception. | |
sigc::signal< void, const Glib::ustring & > | signal_name_changed () |
sigc::signal< void > & | signal_value_changed () |
Signal emitted when the property is changed. | |
virtual void | set_xml (const Glib::ustring &s, bool change_names=false, bool create_missing=true) |
virtual void | set_xml (const xmlpp::Node *n, bool change_names=false, bool create_missing=true) |
virtual void | set_value (const Glib::ustring &v) |
template<typename T> | |
void | set_value (const T &t) |
virtual iterator | properties_end () |
virtual Object & | operator[] (const Glib::ustring &name) throw (error::bad_property_name) |
This method returns an Object reference and throws exceptions when a bad name is encountered. | |
IDIOSKOPOS_OBJECT (WriteOnlyPropertyBase) | |
virtual void | set_value (const Glib::ustring &v) |
virtual void | set (const std::vector< X, A > &val)=0 |
The canonical set() accessor method that also emits the changed signal. | |
virtual void | set_element (int n, const X &x) |
virtual void | set_element (unsigned int n, const X &x) |
virtual void | set_element (long int n, const X &x) |
virtual void | set_element (long unsigned int n, const X &x) |
virtual void | set_xml (const Glib::ustring &s, bool change_names=false, bool create_missing=true) |
virtual void | set_xml (const xmlpp::Node *n, bool change_names=false, bool create_missing=true) |
Protected Member Functions | |
virtual Object::iterator | next_property (size_t i) |
virtual Object::iterator | previous_property (size_t i) |
virtual iterator | next_property (std::set< Object * >::iterator i) |
virtual iterator | previous_property (std::set< Object * >::iterator i) |
virtual std::vector< X, A > & | get_value ()=0 |
Protected Attributes | |
Glib::ustring | m_name |
sigc::signal< void, const Glib::ustring & > | m_signal_name_changed |
sigc::signal< void > | m_signal_value_changed |
Signal emitted when underlying data is changed. |
Idioskopos::PropertyBase< std::vector< X, A > >::PropertyBase | ( | const Glib::ustring & | name | ) | [inline] |
Default constructor that doesn't do much.
Idioskopos::PropertyBase< std::vector< X, A > >::PropertyBase | ( | const Glib::ustring & | name, | |
Introspectable & | container | |||
) | [inline] |
Makes this a property of the introspectable container accessible through the provided name.
PropertyBase<std::vector<X, A> >& Idioskopos::PropertyBase< std::vector< X, A > >::operator= | ( | const std::vector< X, A > & | val | ) | [inline] |
Allows assignment to the property from the contained value type.
Reimplemented from Idioskopos::WriteOnlyPropertyBase< std::vector< X, A > >.
PropertyBase<std::vector<X, A> >& Idioskopos::PropertyBase< std::vector< X, A > >::operator() | ( | const std::vector< X, A > & | val | ) | [inline] |
Function call syntax.
Set the value of the property with property(value) notation.
virtual Glib::ustring Idioskopos::PropertyBase< std::vector< X, A > >::xml | ( | int | indent = -1 |
) | [inline, virtual] |
The get_xml function is a template method with full specializations for known types.
The default implementation returns an XML string filled with the RTTI typeinfo id. This is not a portable approach. However, if you provide a specialization of get_xml() for your class, it _will_ be a portable solution.
Reimplemented from Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >.
const std::type_info& Idioskopos::PropertyBase< std::vector< X, A > >::type | ( | ) | const [inline, virtual] |
Returns the RTTI type id of the contained type.
Reimplemented from Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >.
virtual size_t Idioskopos::PropertyBase< std::vector< X, A > >::num_properties | ( | ) | const [inline, virtual] |
If this is a property container, this should be reimplemented to provide a true count of the number of child properties this container has.
Reimplemented from Idioskopos::Object.
virtual const std::vector<X, A>& Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::get | ( | ) | const [pure virtual, inherited] |
The canonical get() accessor method.
virtual std::vector<X, A>* Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::get_pointer | ( | ) | [pure virtual, inherited] |
Should return a pointer to the contained object, or NULL if pointers are not allowed.
Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::operator const std::vector | ( | ) | const [inline, inherited] |
Allows for implicit casts to the contained type.
const std::vector<X, A>& Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::operator() | ( | ) | const [inline, inherited] |
Function call syntax.
Get the value of the property with property() notation.
std::vector<X, A>* Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::operator-> | ( | ) | [inline, inherited] |
A convenience operator when the property contains a class.
Allows class method to be accessed using notation: property->class_method()
virtual Glib::ustring Idioskopos::ReadOnlyPropertyBase< std::vector< X, A > >::value | ( | ) | [inline, virtual, inherited] |
Similar in concept to the xml() method, this provides a string representation of the contained value if the get_value() template has a meaningful template specialization.
Reimplemented from Idioskopos::Object.
sigc::signal< void, Object * > Idioskopos::Object::signal_property_added | ( | ) | [virtual, inherited] |
Returns the property added signal if this is an introspectable object, otherwise throws an exception.
Reimplemented in Idioskopos::Introspectable.
sigc::signal< void, Object * > Idioskopos::Object::signal_property_removed | ( | ) | [virtual, inherited] |
Returns the property removed signal if this is an introspectable object, otherwise throws an exception.
Reimplemented in Idioskopos::Introspectable.
sigc::signal< void > & Idioskopos::Object::signal_value_changed | ( | ) | [inherited] |
Signal emitted when the property is changed.
Object & Idioskopos::Object::operator[] | ( | const Glib::ustring & | name | ) | throw (error::bad_property_name) [virtual, inherited] |
This method returns an Object reference and throws exceptions when a bad name is encountered.
The alternative would be to return an Object* and return NULL for an unfound name. However, by returning a reference, it is possible to index into objects using array notation, as in myobject["child"]["property"]
Reimplemented in Idioskopos::Introspectable.
virtual void Idioskopos::WriteOnlyPropertyBase< std::vector< X, A > >::set | ( | const std::vector< X, A > & | val | ) | [pure virtual, inherited] |
The canonical set() accessor method that also emits the changed signal.
sigc::signal<void> Idioskopos::Object::m_signal_value_changed [protected, inherited] |
Signal emitted when underlying data is changed.