|
cartobase 6.0.20
|
#include <cartobase/object/object.h>


Public Member Functions | |
| Object | getProperty (const std::string &) const |
| same as the other getProperty() functions except that the value object is returned. | |
| Object | getProperty (Object key) const |
same as the other getProperty() functions except that the key is contained in the key argument (which must implement the StringInterface). | |
| bool | getProperty (const std::string &key, T &value) const |
same as the other getProperty() functions except that the value object must be of exact type T and is copied to the value argument. | |
| void | setProperty (const std::string &, const char *) |
| specific specialization: C strings are stored as std::string objects | |
| void | setProperty (const std::string &, const T &) |
same as the other setProperty() functions except that the value to be set is of the arbitrary type T and will possibly be stored in an Object. | |
| void | setProperty (const std::string &key, Object const &value) |
| TypedObject () | |
| virtual | ~TypedObject () |
| virtual T & | getValue () |
| const T & | getValue () const |
| virtual void | setValue (Object val) |
| virtual Object | clone () const |
| cloning copy | |
| virtual std::string | type () const |
| type() returns the DataTypeCode::name() of the underlying object type | |
| virtual bool | isScalar () const |
| Returns false if the stored object doesn't actually implement the ScalarInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual double | getScalar () const |
| Obtain a scalar value, possibly after a conversion. | |
| virtual void | setScalar (double) |
| The double value will be converted to the actual storage type before it is set in the contained object. | |
| virtual bool | isString () const |
| Returns false if the stored object doesn't actually implement the StringInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual std::string | getString () const |
| Obtain a string value, possibly after a conversion. | |
| virtual void | setString (const std::string &) |
| The string value may be converted to the actual storage type before it is set in the contained object. | |
| virtual bool | isArray () const |
| Returns false if the stored object doesn't actually implement the ArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual bool | isContiguous () const |
| Tells if array indices are contiguous (as in a vector), contrarily to an int key dictionary. | |
| virtual bool | hasItem (int index) const |
| Tells if array item index actually exists. | |
| virtual Object | getArrayItem (int index) const |
Get the element of index index. | |
| virtual void | setArrayItem (int, Object) |
| virtual size_t | size () const |
| Number of sub-elements. | |
| virtual bool | isDynArray () const |
| Returns false if the stored object doesn't actually implement the DynArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual void | reserveArray (size_t) |
| like the STL vector::reserve(), memory is reserved but no element is stored | |
| virtual void | resizeArray (size_t) |
| resize the array. | |
| virtual void | removeArrayItem (int) |
| removes an element from the array. | |
| virtual void | insertArrayItem (int, Object) |
| inserts an element into the array. | |
| virtual bool | getProperty (const std::string &, Object &) const |
Access the element ok key key. | |
| Object | getProperty (const std::string &) const |
| same as the other getProperty() functions except that the value object is returned. | |
| Object | getProperty (Object key) const |
same as the other getProperty() functions except that the key is contained in the key argument (which must implement the StringInterface). | |
| bool | getProperty (const std::string &key, T &value) const |
same as the other getProperty() functions except that the value object must be of exact type T and is copied to the value argument. | |
| virtual bool | isDictionary () const |
| Returns false if the stored object doesn't actually implement the DictionaryInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual void | setProperty (const std::string &, Object) |
Set (insert or replace) the element of key key with the value object. | |
| void | setProperty (const std::string &, const char *) |
| specific specialization: C strings are stored as std::string objects | |
| void | setProperty (const std::string &, const T &) |
same as the other setProperty() functions except that the value to be set is of the arbitrary type T and will possibly be stored in an Object. | |
| void | setProperty (const std::string &key, Object const &value) |
| virtual bool | removeProperty (const std::string &) |
| remove an element. | |
| virtual bool | hasProperty (const std::string &) const |
check if an element exists under the key key | |
| virtual void | clearProperties () |
| clear the dictionary | |
| virtual bool | isIterable () const |
| Returns false if the stored object doesn't actually implement the IterableInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual Object | objectIterator () const |
| returns an object implementing the IteratorIntrerface | |
| virtual bool | isIterator () const |
| Returns false if the stored object doesn't actually implement the IteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual bool | isValid () const |
true if the iterator points to a valid value, false when the end of the iterable container has been reached | |
| virtual Object | currentValue () const |
| Access the value of the element pointed to by the iterator. | |
| virtual void | next () |
| Point to the next element of the iterable container. | |
| virtual bool | isKeyIterator () const |
| Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual Object | keyObject () const |
| Access the key of the current element. | |
| virtual bool | isDictionaryIterator () const |
| Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual std::string | key () const |
| Access the key of the current dictionary element. | |
| virtual bool | isIntKeyIterator () const |
| Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual long | intKey () const |
| Access the key of the current dictionary element. | |
| virtual bool | isNone () const |
| Returns false if the stored object doesn't actually implement the NoneInterface API (needed since all GenericObject inherit this interface whatever they actually contain) | |
| virtual bool | operator== (const GenericObject &other) const |
Public Member Functions inherited from carto::GenericObject | |
| virtual | ~GenericObject () |
| template<typename T> | |
| const T & | value () const |
| Retrieve value in object, const reference. | |
| template<typename T> | |
| T & | value () |
| Retrieve value in object, by non-const reference. | |
| template<typename T> | |
| bool | value (T &) const |
| Retrieve value in object, and store it in a variable. | |
| template<typename T> | |
| void | setValue (const T &val) |
| Store value in object by copying it. | |
| template<typename T> | |
| T * | getInterface () |
| Obtain a specific Interface subclass. | |
| template<typename T> | |
| const T * | getInterface () const |
| const access to an interface | |
| virtual bool | operator!= (const GenericObject &other) const |
Public Member Functions inherited from carto::RCObject | |
| RCObject () | |
| RCObject (const RCObject &) | |
| RCObject & | operator= (const RCObject &) |
| virtual | ~RCObject () |
Public Member Functions inherited from carto::StringInterface | |
| virtual | ~StringInterface () |
| virtual bool | operator== (const StringInterface &other) const |
| equality test | |
| virtual bool | operator!= (const StringInterface &other) const |
Public Member Functions inherited from carto::Interface | |
| virtual | ~Interface () |
Public Member Functions inherited from carto::ScalarInterface | |
| virtual | ~ScalarInterface () |
| virtual bool | operator== (const ScalarInterface &other) const |
| equality test | |
| virtual bool | operator!= (const ScalarInterface &other) const |
Public Member Functions inherited from carto::DynArrayInterface | |
| virtual | ~DynArrayInterface () |
Public Member Functions inherited from carto::ArrayInterface | |
| virtual | ~ArrayInterface () |
Public Member Functions inherited from carto::SizeInterface | |
| virtual | ~SizeInterface () |
Public Member Functions inherited from carto::IterableInterface | |
| virtual | ~IterableInterface () |
| virtual bool | operator== (const IterableInterface &other) const |
| equality test | |
| virtual bool | operator!= (const IterableInterface &other) const |
Public Member Functions inherited from carto::DictionaryInterface | |
| virtual | ~DictionaryInterface () |
| Object | getProperty (const std::string &) const |
| same as the other getProperty() functions except that the value object is returned. | |
| Object | getProperty (Object key) const |
same as the other getProperty() functions except that the key is contained in the key argument (which must implement the StringInterface). | |
| template<typename T> | |
| bool | getProperty (const std::string &key, T &value) const |
same as the other getProperty() functions except that the value object must be of exact type T and is copied to the value argument. | |
| void | setProperty (const std::string &, const char *) |
| specific specialization: C strings are stored as std::string objects | |
| template<typename T> | |
| void | setProperty (const std::string &, const T &) |
same as the other setProperty() functions except that the value to be set is of the arbitrary type T and will possibly be stored in an Object. | |
| virtual void | copyProperties (Object source) |
copy all properties of the source object to this object. | |
| virtual bool | operator== (const DictionaryInterface &other) const |
| equality test | |
| virtual bool | operator!= (const DictionaryInterface &other) const |
| template<> | |
| void | setProperty (const std::string &key, Object const &value) |
| template<> | |
| bool | getProperty (const std::string &key, Object &value) const |
Public Member Functions inherited from carto::IteratorInterface | |
| virtual | ~IteratorInterface () |
Public Member Functions inherited from carto::KeyIteratorInterface | |
| virtual | ~KeyIteratorInterface () |
Public Member Functions inherited from carto::DictionaryIteratorInterface | |
| virtual | ~DictionaryIteratorInterface () |
Public Member Functions inherited from carto::IntKeyIteratorInterface | |
| virtual | ~IntKeyIteratorInterface () |
Public Member Functions inherited from carto::NoneInterface | |
| virtual | ~NoneInterface () |
Additional Inherited Members | |
Public Types inherited from carto::RCObject | |
| typedef int | RefCounterType |
Static Protected Member Functions inherited from carto::DefaultRefConstruction | |
| template<class T> | |
| static const T * | release (const_ref< T > *) |
| carto::TypedObject< T >::TypedObject | ( | ) |
Definition at line 673 of file object_d.h.
|
virtual |
Definition at line 674 of file object_d.h.
|
virtual |
clear the dictionary
Reimplemented from carto::DictionaryInterface.
Definition at line 725 of file object_d.h.
|
virtual |
|
virtual |
Access the value of the element pointed to by the iterator.
Implements carto::IteratorInterface.
Definition at line 734 of file object_d.h.
|
virtual |
Get the element of index index.
An exception will be thrown if the stored object doesn't actually implement the ArrayInterface. But if it does, access to an element of index greater or equal to size() should not be attempted: depending on the exact storage type and array implementation, it can either throw an exception, or simply crash the program.
Implements carto::ArrayInterface.
Definition at line 704 of file object_d.h.
References isScalar().
| ( | const std::string & | ) | const |
same as the other getProperty() functions except that the value object is returned.
An exception is thrown in case of failure.
| Object carto::DictionaryInterface::getProperty | ( | const std::string & | ) | const |
same as the other getProperty() functions except that the value object is returned.
An exception is thrown in case of failure.
References carto::DictionaryInterface::getProperty(), and carto::GenericObject::Object.
|
virtual |
Access the element ok key key.
value is filled with a wrapper to the selected element. If it fails (key not found for instance), an exception is thrown.
Implements carto::DictionaryInterface.
Definition at line 716 of file object_d.h.
References isIterable().
| ( | const std::string & | key, | |
| T & | value ) const |
same as the other getProperty() functions except that the value object must be of exact type T and is copied to the value argument.
No exception is thrown if the key is not found or the selected element is not of type T, but the return value is false if it fails. An exception is still thrown if this function is called on an object that doesn't actually implement the DictionaryInterface API.
| bool carto::DictionaryInterface::getProperty | ( | const std::string & | key, |
| T & | value ) const |
same as the other getProperty() functions except that the value object must be of exact type T and is copied to the value argument.
No exception is thrown if the key is not found or the selected element is not of type T, but the return value is false if it fails. An exception is still thrown if this function is called on an object that doesn't actually implement the DictionaryInterface API.
| ( | Object | key | ) | const |
same as the other getProperty() functions except that the key is contained in the key argument (which must implement the StringInterface).
The value object is returned. An exception is thrown in case of failure.
same as the other getProperty() functions except that the key is contained in the key argument (which must implement the StringInterface).
The value object is returned. An exception is thrown in case of failure.
|
virtual |
Obtain a scalar value, possibly after a conversion.
This method may throw an exception if the stored object has not a scalar-compatible interface
Implements carto::ScalarInterface.
Definition at line 692 of file object_d.h.
|
virtual |
Obtain a string value, possibly after a conversion.
This method may throw an exception if the stored object has not a string-compatible interface
Implements carto::StringInterface.
Definition at line 697 of file object_d.h.
|
virtual |
Definition at line 679 of file object_d.h.
|
inline |
Definition at line 680 of file object_d.h.
|
virtual |
Tells if array item index actually exists.
False if index exceeds a vector size, or if it is not part of a dict key, for example.
Implements carto::ArrayInterface.
Definition at line 703 of file object_d.h.
|
virtual |
check if an element exists under the key key
Implements carto::DictionaryInterface.
Definition at line 724 of file object_d.h.
|
virtual |
inserts an element into the array.
All elements after this one may be moved, so iterators pointing after it may become invalid
Implements carto::DynArrayInterface.
Definition at line 713 of file object_d.h.
|
virtual |
Access the key of the current dictionary element.
Implements carto::IntKeyIteratorInterface.
Definition at line 747 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the ArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::ArrayInterface.
Definition at line 701 of file object_d.h.
|
virtual |
Tells if array indices are contiguous (as in a vector), contrarily to an int key dictionary.
Implements carto::ArrayInterface.
Definition at line 702 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the DictionaryInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::DictionaryInterface.
Definition at line 717 of file object_d.h.
Referenced by removeArrayItem().
|
virtual |
Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::DictionaryIteratorInterface.
Definition at line 742 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the DynArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::DynArrayInterface.
Definition at line 709 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::IntKeyIteratorInterface.
Definition at line 746 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the IterableInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::IterableInterface.
Definition at line 728 of file object_d.h.
Referenced by getProperty().
|
virtual |
Returns false if the stored object doesn't actually implement the IteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::IteratorInterface.
Definition at line 732 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the DictionaryIteratorInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::KeyIteratorInterface.
Definition at line 738 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the NoneInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Implements carto::NoneInterface.
Definition at line 750 of file object_d.h.
|
virtual |
Returns false if the stored object doesn't actually implement the ScalarInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::ScalarInterface.
Definition at line 691 of file object_d.h.
Referenced by getArrayItem().
|
virtual |
Returns false if the stored object doesn't actually implement the StringInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented from carto::StringInterface.
Definition at line 696 of file object_d.h.
Referenced by size().
|
virtual |
true if the iterator points to a valid value, false when the end of the iterable container has been reached
Implements carto::IteratorInterface.
Definition at line 733 of file object_d.h.
|
virtual |
Access the key of the current dictionary element.
Implements carto::DictionaryIteratorInterface.
Definition at line 743 of file object_d.h.
|
virtual |
Access the key of the current element.
Implements carto::KeyIteratorInterface.
Definition at line 739 of file object_d.h.
|
virtual |
Point to the next element of the iterable container.
Implements carto::IteratorInterface.
Definition at line 735 of file object_d.h.
|
virtual |
returns an object implementing the IteratorIntrerface
Implements carto::IterableInterface.
Definition at line 729 of file object_d.h.
|
virtual |
Reimplemented from carto::GenericObject.
Definition at line 752 of file object_d.h.
|
virtual |
removes an element from the array.
All elements after the one removed may be moved, so iterators pointing after it may become invalid
Implements carto::DynArrayInterface.
Definition at line 712 of file object_d.h.
References isDictionary().
|
virtual |
remove an element.
Note that on some dictionary implementations (PropertySet with builtin properties for instance), some properties cannot be removed.
Implements carto::DictionaryInterface.
Definition at line 723 of file object_d.h.
|
virtual |
like the STL vector::reserve(), memory is reserved but no element is stored
Implements carto::DynArrayInterface.
Definition at line 710 of file object_d.h.
|
virtual |
resize the array.
This may need to copy all existing elements, so all iterators may become invalid after this operation
Implements carto::DynArrayInterface.
Definition at line 711 of file object_d.h.
|
virtual |
Implements carto::ArrayInterface.
Definition at line 705 of file object_d.h.
| ( | const std::string & | , | |
| const char * | ) |
specific specialization: C strings are stored as std::string objects
| void carto::DictionaryInterface::setProperty | ( | const std::string & | , |
| const char * | ) |
specific specialization: C strings are stored as std::string objects
References carto::GenericObject::Object, and carto::DictionaryInterface::setProperty().
| ( | const std::string & | , | |
| const T & | value ) |
same as the other setProperty() functions except that the value to be set is of the arbitrary type T and will possibly be stored in an Object.
The same type restrictions apply as for the other setProperty() functions
| void carto::DictionaryInterface::setProperty | ( | const std::string & | , |
| const T & | value ) |
same as the other setProperty() functions except that the value to be set is of the arbitrary type T and will possibly be stored in an Object.
The same type restrictions apply as for the other setProperty() functions
|
virtual |
Set (insert or replace) the element of key key with the value object.
On some specific dictionary implementations (such as PropertySet with builtin properties, or maps of specific, typed values), an existing property cannot change type. In this case value must hold an object of the correct type, otherwise an exception will be thrown.
Implements carto::DictionaryInterface.
Definition at line 720 of file object_d.h.
| ( | const std::string & | key, | |
| Object const & | value ) |
| void carto::DictionaryInterface::setProperty | ( | const std::string & | key, |
| Object const & | value ) |
|
virtual |
The double value will be converted to the actual storage type before it is set in the contained object.
This method may throw an exception if the stored object has not a scalar-compatible interface
Implements carto::ScalarInterface.
Definition at line 693 of file object_d.h.
|
virtual |
The string value may be converted to the actual storage type before it is set in the contained object.
This method may throw an exception if the stored object has not a string-compatible interface
Implements carto::StringInterface.
Definition at line 698 of file object_d.h.
|
virtual |
Implements carto::GenericObject.
Definition at line 681 of file object_d.h.
|
virtual |
Number of sub-elements.
This method may throw an exception if the stored object has not a size-compatible interface
Implements carto::GenericObject.
Definition at line 706 of file object_d.h.
References isString().
|
virtual |
type() returns the DataTypeCode::name() of the underlying object type
Implements carto::GenericObject.
Definition at line 688 of file object_d.h.