#include <Vocabulary.hpp>
Definition at line 38 of file Vocabulary.hpp.
Public Types | |
| typedef unsigned long | TermRef |
| data type for numeric term references | |
|
typedef boost::shared_ptr< Term > | TermPtr |
| data type for a pointer to a Term object | |
| TYPE_NULL = 0 | |
| NULL or undefined type. | |
| TYPE_INT8 | |
| 8-bit, signed integer (uses boost::int32_t) | |
| TYPE_UINT8 | |
| 8-bit, unsigned integer (uses boost::uint32_t) | |
| TYPE_INT16 | |
| 16-bit, signed integer (uses boost::int32_t) | |
| TYPE_UINT16 | |
| 16-bit, unsigned integer (uses boost::uint32_t) | |
| TYPE_INT32 | |
| 32-bit, signed integer (uses boost::int32_t) | |
| TYPE_UINT32 | |
| 32-bit, unsigned integer (uses boost::uint32_t) | |
| TYPE_INT64 | |
| 64-bit, signed integer (uses boost::int64_t) | |
| TYPE_UINT64 | |
| 64-bit, unsigned integer (uses boost::uint64_t) | |
| TYPE_FLOAT | |
| floating point number (uses float) | |
| TYPE_DOUBLE | |
| large floating point number (uses double) | |
| TYPE_LONG_DOUBLE | |
| very large floating point number (uses long double) | |
| TYPE_SHORT_STRING | |
| variable-length string up to 255 bytes | |
| TYPE_STRING | |
| variable-length string up to 65535 bytes | |
| TYPE_LONG_STRING | |
| variable-length string up to 2^32-1 bytes | |
| TYPE_DATE_TIME | |
| represents a specific date and/or time using term_format | |
| TYPE_DATE | |
| represents a specific date using term_format | |
| TYPE_TIME | |
| represents a specific time of day using term_format | |
| TYPE_CHAR | |
| fixed-length string of size term_size | |
| TYPE_BLOB | |
| BLOB; like longstring, but may contain NULLs. | |
| TYPE_ZBLOB | |
| ZBLOB; like BLOB except, that it gets compressed in/out a DB. | |
| TYPE_OBJECT | |
| object is currently reserved for Event Types | |
| enum | DataType { TYPE_NULL = 0, TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_INT64, TYPE_UINT64, TYPE_FLOAT, TYPE_DOUBLE, TYPE_LONG_DOUBLE, TYPE_SHORT_STRING, TYPE_STRING, TYPE_LONG_STRING, TYPE_DATE_TIME, TYPE_DATE, TYPE_TIME, TYPE_CHAR, TYPE_BLOB, TYPE_ZBLOB, TYPE_OBJECT } |
| data type for the type of data that a term represents More... | |
Public Member Functions | |
| ~Vocabulary () | |
| public destructor: not virtual, should not be extended | |
| Vocabulary (void) | |
| constructs a new Vocabulary instance | |
| Vocabulary (const Vocabulary &v) | |
| (copy) constructs a new Vocabulary instance | |
| size_t | size (void) const |
| returns the number of Terms that are defined within the Vocabulary | |
| const Term & | operator[] (const TermRef &term_ref) const |
| TermRef | findTerm (const std::string &term_id) const |
| const Term & | findTerm (const TermRef &term_ref) const |
| TermRef | addTerm (const Term &t) |
| void | removeTerm (const std::string &term_id) |
| void | updateTerm (const Term &t) |
| void | refreshTerm (Term &t) const |
| const Vocabulary & | operator+= (const Vocabulary &v) |
Static Public Member Functions | |
| static DataType | parseDataType (std::string str) |
| static std::string | getDataTypeAsString (const DataType type) |
Static Public Attributes | |
| static const TermRef | UNDEFINED_TERM_REF = 0 |
| null term reference constant (0) | |
Classes | |
| class | DuplicateTermException |
| exception thrown if you try to add a duplicate Term More... | |
| class | EmptyTermIdException |
| exception thrown if you try to add a term with an empty identifier More... | |
| struct | Term |
| data type for vocabulary terms More... | |
| class | TermNoLongerDefinedException |
| exception thrown by refreshTerm() if a Term in use is no longer defined More... | |
| class | TermNotFoundException |
| exception thrown if there is a problem finding a Term More... | |
| class | UnknownDataTypeException |
| exception thrown if the DataType is not recognized More... | |
data type for the type of data that a term represents
Definition at line 49 of file Vocabulary.hpp.
| Vocabulary::TermRef pion::platform::Vocabulary::addTerm | ( | const Term & | t | ) |
adds a new Term if it has not yet been defined
| t | the Term to identify or define |
Definition at line 51 of file Vocabulary.cpp.
References pion::platform::Vocabulary::Term::term_comment, pion::platform::Vocabulary::Term::term_format, pion::platform::Vocabulary::Term::term_id, pion::platform::Vocabulary::Term::term_size, pion::platform::Vocabulary::Term::term_type, and TYPE_CHAR.
Referenced by pion::platform::VocabularyConfig::addTerm(), pion::platform::VocabularyConfig::bind(), pion::platform::VocabularyConfig::openConfigFile(), operator+=(), and updateTerm().
returns the Term, identified with the TermRef
| term_ref | term_ref of the Term to be found |
Definition at line 199 of file Vocabulary.hpp.
| TermRef pion::platform::Vocabulary::findTerm | ( | const std::string & | term_id | ) | const [inline] |
returns the numeric Term identifier for a Term
| term_id | unique identifier for the Term |
Definition at line 185 of file Vocabulary.hpp.
Referenced by refreshTerm(), pion::platform::RuleChain::setConfig(), pion::platform::Protocol::setConfig(), pion::platform::DatabaseInserter::setConfig(), pion::platform::Codec::setConfig(), pion::plugins::TransformReactor::setConfig(), pion::plugins::FissionReactor::setConfig(), pion::plugins::XMLCodec::setConfig(), pion::plugins::LogCodec::setConfig(), pion::plugins::JSONCodec::setConfig(), pion::platform::TransformAssignTerm::TransformAssignTerm(), pion::platform::TransformJoinTerm::TransformJoinTerm(), pion::platform::TransformLookup::TransformLookup(), pion::platform::TransformRegex::TransformRegex(), pion::platform::TransformRules::TransformRules(), pion::platform::TransformSplitTerm::TransformSplitTerm(), pion::platform::TransformURLDecode::TransformURLDecode(), pion::platform::TransformURLEncode::TransformURLEncode(), pion::plugins::PythonReactor::updateTerms(), and pion::platform::VocabularyManager::writeTermConfigXML().
| std::string pion::platform::Vocabulary::getDataTypeAsString | ( | const DataType | type | ) | [static] |
returns a string that represents a particular data type
| type | the data type to get a string for |
Definition at line 211 of file Vocabulary.cpp.
References TYPE_BLOB, TYPE_CHAR, TYPE_DATE, TYPE_DATE_TIME, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_LONG_DOUBLE, TYPE_LONG_STRING, TYPE_NULL, TYPE_OBJECT, TYPE_SHORT_STRING, TYPE_STRING, TYPE_TIME, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, and TYPE_ZBLOB.
Referenced by pion::platform::VocabularyConfig::updateTerm(), and pion::platform::VocabularyConfig::writeTermConfigXML().
| const Vocabulary & pion::platform::Vocabulary::operator+= | ( | const Vocabulary & | v | ) |
Incorporates all the data from another Vocabulary into this one
| v | the Vocabulary object copy data from |
Definition at line 144 of file Vocabulary.cpp.
References addTerm(), m_num_terms, m_ref_map, and UNDEFINED_TERM_REF.
Referenced by Vocabulary().
returns a reference to the definition for a particular Term
| term_ref | reference number assigned to the Term |
Definition at line 174 of file Vocabulary.hpp.
| Vocabulary::DataType pion::platform::Vocabulary::parseDataType | ( | std::string | str | ) | [static] |
parses data type from a string
| str | the string to parse |
Definition at line 156 of file Vocabulary.cpp.
References TYPE_BLOB, TYPE_CHAR, TYPE_DATE, TYPE_DATE_TIME, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_LONG_DOUBLE, TYPE_LONG_STRING, TYPE_NULL, TYPE_OBJECT, TYPE_SHORT_STRING, TYPE_STRING, TYPE_TIME, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, and TYPE_ZBLOB.
Referenced by pion::platform::VocabularyConfig::parseTermConfig(), and pion::platform::Database::readConfigDetails().
| void pion::platform::Vocabulary::refreshTerm | ( | Term & | t | ) | const |
refresh a Term copy after Vocabulary was updated
Definition at line 131 of file Vocabulary.cpp.
References findTerm(), pion::platform::Vocabulary::Term::term_id, and UNDEFINED_TERM_REF.
Referenced by pion::platform::Comparison::updateVocabulary(), pion::plugins::FissionReactor::updateVocabulary(), pion::plugins::XMLCodec::updateVocabulary(), pion::plugins::LogCodec::updateVocabulary(), and pion::plugins::JSONCodec::updateVocabulary().
| void pion::platform::Vocabulary::removeTerm | ( | const std::string & | term_id | ) |
removes a Term from the Vocabulary (use with caution!!!)
| term_id | unique identifier for the Term to remove |
Definition at line 80 of file Vocabulary.cpp.
References UNDEFINED_TERM_REF.
Referenced by pion::platform::VocabularyConfig::bind(), and pion::platform::VocabularyConfig::removeTerm().
| void pion::platform::Vocabulary::updateTerm | ( | const Term & | t | ) |
update the settings for a Term
Definition at line 100 of file Vocabulary.cpp.
References addTerm(), pion::platform::Vocabulary::Term::term_comment, pion::platform::Vocabulary::Term::term_format, pion::platform::Vocabulary::Term::term_id, pion::platform::Vocabulary::Term::term_size, and pion::platform::Vocabulary::Term::term_type.
Referenced by pion::platform::VocabularyConfig::bind(), and pion::platform::VocabularyConfig::updateTerm().
1.4.7