|
Telescience Resource Kit
TReK C++
5.4.0 ART
|
This class provides the common set of names and descriptions allowed for items in the Data API. More...
#include <named_item.h>
Inherited by trek::Calibrator, trek::Dependency, trek::ExpectedStateAlarm, trek::LimitAlarm, trek::PacketItem, trek::Parameter, and trek::SwitchSet.
Public Member Functions | |
void | SetName (const char *input_ptr) |
Sets the name of the item. More... | |
void | SetAlias (const char *input) |
Sets the alias of the item. More... | |
void | SetShortDescription (const char *input_ptr) |
Sets the short description of the item. More... | |
void | SetLongDescription (const char *input_ptr) |
Sets the long description of the item. More... | |
void | SetUserDescription (const char *input_ptr) |
Sets the user description of the item. More... | |
void | SetOwner (const char *input_ptr) |
Sets the owner of the item. More... | |
void | SetPath (const char *input_ptr) |
Sets the path for the item. More... | |
const char * | GetName () |
Returns the name of the item. | |
const char * | GetAlias () |
Returns the alias of the item. | |
const char * | GetShortDescription () |
Returns the short description of the item. | |
const char * | GetLongDescription () |
Returns the long description of the item. | |
const char * | GetUserDescription () |
Returns the user description of the item. | |
const char * | GetOwner () |
Returns the owner of the item. | |
const char * | GetPath () |
Returns the path for the item. | |
int32_t | AddAttribute (const char *name, const char *value) |
Adds an attribute to the item. More... | |
void | GetAttributeList (StringArray &attr_array) |
Gets a list of the attribute names. More... | |
int32_t | GetAttribute (const char *name, char *value, uint32_t &value_len) |
Get the value of the specified attribute. More... | |
Constructors, Destructor, and Other Basic Methods | |
NamedItem () | |
Default constructor of the class. | |
NamedItem (NamedItem &input) | |
Copy constructor of the class. | |
virtual | ~NamedItem () |
Class destructor. More... | |
virtual void | Init () |
Initializes the object. | |
void | operator= (NamedItem &right_side) |
Provides the equal operator. | |
bool | operator== (NamedItem &right_side) |
Provides the == operator. | |
This class provides the common set of names and descriptions allowed for items in the Data API.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
int32_t trek::NamedItem::AddAttribute | ( | const char * | name, |
const char * | value | ||
) |
Adds an attribute to the item.
[in] | name | The name of the attribute. |
[in] | value | The value of the attribute. |
Example:
int32_t trek::NamedItem::GetAttribute | ( | const char * | name, |
char * | value, | ||
uint32_t & | value_len | ||
) |
Get the value of the specified attribute.
[in] | name | - The name of the attribute to retrieve. |
[out] | str_value | - The returned attribute value. |
[in/out] | value_len - The number of bytes available in str_value. If TREK_DATA_NOT_ENOUGH_SPACE is returned the value is set to the required minimum value. |
Example:
void trek::NamedItem::GetAttributeList | ( | StringArray & | attr_array | ) |
Gets a list of the attribute names.
[out] | attr_array | Used to hold list of names. A length of zero indicates no attributes are available. |
Example:
void trek::NamedItem::SetAlias | ( | const char * | input_ptr | ) |
Sets the alias of the item.
There is no restriction on the length of the alias. However, individual projects may impose length restrictions.
[in] | input_ptr | The new alias for the item. |
void trek::NamedItem::SetLongDescription | ( | const char * | input_ptr | ) |
Sets the long description of the item.
There is no restriction on the length of the long description. However, individual projects may impose length restrictions.
[in] | input_ptr | The new long description for the item. |
void trek::NamedItem::SetName | ( | const char * | input_ptr | ) |
Sets the name of the item.
There is no restriction on the length of the name. However, individual projects may impose length restrictions.
[in] | input_ptr | The new name for the item. |
void trek::NamedItem::SetOwner | ( | const char * | input_ptr | ) |
Sets the owner of the item.
There is no restriction on the length of the owner. However, individual projects may impose length restrictions.
[in] | input_ptr | The new owner for the item. |
void trek::NamedItem::SetPath | ( | const char * | input_ptr | ) |
Sets the path for the item.
There is no restriction on the length of the path. It can be used to support a path like name for the item for informational purposes.
[in] | input_ptr | The new path for the item. |
void trek::NamedItem::SetShortDescription | ( | const char * | input_ptr | ) |
Sets the short description of the item.
There is no restriction on the length of the short description. However, individual projects may impose length restrictions.
[in] | input_ptr | The new short description for the item. |
void trek::NamedItem::SetUserDescription | ( | const char * | input_ptr | ) |
Sets the user description of the item.
There is no restriction on the length of the user description. However, individual projects may impose length restrictions.
[in] | input_ptr | The new user description for the item. |