Implements attributed features, that is in the simplest case a number of (attribute, value) pairs.
For example
x[0...].attr1 = <value(s)> x[0...].attr2 = <value(s)>.
A more complex example would be nested structures x[0...].attr1[0...].subattr1 = ..
This might be used to represent (attr, value) pairs, simple structures, trees ...
Definition at line 43 of file AttributeFeatures.h.
Public Member Functions | |
CAttributeFeatures () | |
virtual | ~CAttributeFeatures () |
CFeatures * | get_attribute (char *attr_name) |
void | get_attribute_by_index (int idx, const char *&attr_name, CFeatures *&attr_obj) |
bool | set_attribute (char *attr_name, CFeatures *attr_obj) |
bool | del_attribute (char *attr_name) |
int32_t | get_num_attributes () |
virtual const char * | get_name () const |
Protected Member Functions | |
int32_t | find_attr_index (char *attr_name) |
Protected Attributes | |
CDynamicArray< T_ATTRIBUTE > | features |
list of attributes (sorted) |
CAttributeFeatures::CAttributeFeatures | ( | ) |
default constructor
Definition at line 14 of file AttributeFeatures.cpp.
CAttributeFeatures::~CAttributeFeatures | ( | ) | [virtual] |
destructor
Definition at line 19 of file AttributeFeatures.cpp.
bool CAttributeFeatures::del_attribute | ( | char * | attr_name | ) |
delete the attribute matching attribute name
attr_name | attribute name |
Definition at line 111 of file AttributeFeatures.h.
int32_t CAttributeFeatures::find_attr_index | ( | char * | attr_name | ) | [protected] |
find the index of the attribute matching attribute name
attr_name | attribute name |
Definition at line 144 of file AttributeFeatures.h.
CFeatures* CAttributeFeatures::get_attribute | ( | char * | attr_name | ) |
return the feature object matching attribute name
attr_name | attribute name |
Definition at line 58 of file AttributeFeatures.h.
void CAttributeFeatures::get_attribute_by_index | ( | int | idx, | |
const char *& | attr_name, | |||
CFeatures *& | attr_obj | |||
) |
return the feature object at index
idx | index of attribute | |
attr_name | attribute name (returned by reference) | |
attr_obj | attribute object (returned by reference) |
Definition at line 77 of file AttributeFeatures.h.
virtual const char* CAttributeFeatures::get_name | ( | ) | const [virtual] |
int32_t CAttributeFeatures::get_num_attributes | ( | ) |
get number of attributes
Definition at line 130 of file AttributeFeatures.h.
bool CAttributeFeatures::set_attribute | ( | char * | attr_name, | |
CFeatures * | attr_obj | |||
) |
set the feature object for attribute name
attr_name | attribute name | |
attr_obj | feature object to set |
Definition at line 91 of file AttributeFeatures.h.
CDynamicArray<T_ATTRIBUTE> CAttributeFeatures::features [protected] |
list of attributes (sorted)
Definition at line 159 of file AttributeFeatures.h.