InterfaceField Class Reference
Interface generator internal representation of a field as parsed from the XML template file. More...
#include <interfaces/generator/field.h>
Public Member Functions | |
| InterfaceField (std::vector< InterfaceEnumConstant > *enum_constants=NULL) | |
| Constructor. | |
| void | setComment (const std::string &comment) |
| Set comment of field. | |
| void | setName (const std::string &name) |
| Set name of field. | |
| void | setType (const std::string &type) |
| Set type of field. | |
| bool | isEnumType () const |
| Check if type is an enum type. | |
| void | setLength (const std::string &length) |
| Set length of field. | |
| void | setFlags (const std::vector< std::string > &flags) |
| Set flags. | |
| void | setValidFor (const std::string &validfor) |
| Set valid for time. | |
| void | setDefaultValue (const std::string &default_value) |
| Set default value. | |
| void | setAttribute (const std::string &attr_name, const std::string &attr_value) |
| Set attribute. | |
| void | valid () |
| Assert validity. | |
| std::string | getName () const |
| Get name of field. | |
| std::string | getComment () const |
| Get comment of field. | |
| std::string | getType () const |
| Get type of field. | |
| std::string | getAccessType () const |
| Get type as used for accessor methods of class. | |
| std::string | getStructType () const |
| Get type used to formulate struct. | |
| std::string | getPlainAccessType () const |
| Get non-array accessor type. | |
| std::string | getLength () const |
| Get field length. | |
| unsigned int | getLengthValue () const |
| Get length value. | |
| std::vector< std::string > | getFlags () const |
| Get flags. | |
| std::string | getValidFor () const |
| Get valid for time. | |
| std::string | getDefaultValue () const |
| Get default value. | |
| bool | operator< (const InterfaceField &f) const |
| Check order of two elements. | |
Detailed Description
Interface generator internal representation of a field as parsed from the XML template file.Definition at line 31 of file field.h.
Constructor & Destructor Documentation
| InterfaceField::InterfaceField | ( | std::vector< InterfaceEnumConstant > * | enum_constants = NULL |
) |
Member Function Documentation
| std::string InterfaceField::getAccessType | ( | ) | const |
| std::string InterfaceField::getComment | ( | ) | const |
| std::string InterfaceField::getDefaultValue | ( | ) | const |
| std::vector< std::string > InterfaceField::getFlags | ( | ) | const |
| std::string InterfaceField::getLength | ( | ) | const |
| unsigned int InterfaceField::getLengthValue | ( | ) | const |
| std::string InterfaceField::getName | ( | void | ) | const |
| std::string InterfaceField::getPlainAccessType | ( | ) | const |
| std::string InterfaceField::getStructType | ( | ) | const |
| std::string InterfaceField::getType | ( | ) | const |
| std::string InterfaceField::getValidFor | ( | ) | const |
| bool InterfaceField::isEnumType | ( | ) | const |
| bool InterfaceField::operator< | ( | const InterfaceField & | f | ) | const |
Check order of two elements.
The overall order is like the following: 1. unsigned int 2. int 3. unsigned long int 4. long int 5. float 6. double 7. bool 8. byte 9. char *
- Parameters:
-
f field to compare to
- Returns:
- true, if current instance is small than f, false otherwise
| void InterfaceField::setAttribute | ( | const std::string & | attr_name, | |
| const std::string & | attr_value | |||
| ) |
Set attribute.
- Parameters:
-
attr_name attribute name attr_value attribute value.
Definition at line 309 of file field.cpp.
References setDefaultValue(), setLength(), setName(), setType(), and setValidFor().
Referenced by InterfaceParser::getFields().
| void InterfaceField::setComment | ( | const std::string & | comment | ) |
Set comment of field.
- Parameters:
-
comment new comment of field.
Definition at line 231 of file field.cpp.
Referenced by InterfaceParser::getFields().
| void InterfaceField::setDefaultValue | ( | const std::string & | default_value | ) |
Set default value.
- Parameters:
-
default_value new default value
Definition at line 262 of file field.cpp.
Referenced by setAttribute().
| void InterfaceField::setFlags | ( | const std::vector< std::string > & | flags | ) |
| void InterfaceField::setLength | ( | const std::string & | length | ) |
Set length of field.
- Parameters:
-
length set length of field.
Definition at line 241 of file field.cpp.
Referenced by setAttribute().
| void InterfaceField::setName | ( | const std::string & | name | ) |
Set name of field.
- Parameters:
-
name new name of field.
Definition at line 221 of file field.cpp.
Referenced by setAttribute().
| void InterfaceField::setType | ( | const std::string & | type | ) |
Set type of field.
- Parameters:
-
type new type of field.
Definition at line 203 of file field.cpp.
Referenced by setAttribute().
| void InterfaceField::setValidFor | ( | const std::string & | validfor | ) |
Set valid for time.
- Parameters:
-
validfor new valid for time
Definition at line 252 of file field.cpp.
Referenced by setAttribute().
| void InterfaceField::valid | ( | ) |
Assert validity.
Calling valid() acts like an assertion. An Exception is thrown if something is wrong.
- Exceptions:
-
InterfaceGeneratorInvalidTypeException thrown if InterfaceDataTypeChecker reports invalid type. InterfaceGeneratorInvalidValueException thrown if any supplied value is illegal. InterfaceGeneratorInvalidFlagException thrown if invalid flag has been supplied.
Definition at line 337 of file field.cpp.
References InterfaceDataTypeChecker::validType(), and InterfaceDataTypeChecker::validValue().
Referenced by InterfaceParser::getFields().
The documentation for this class was generated from the following files:

