28 #ifndef CMHPropertiesValuesList_H
29 #define CMHPropertiesValuesList_H
51 TPropertyValueIDTriplet() : name(), value(NULL),ID(0)
80 CMHPropertiesValuesList( const CMHPropertiesValuesList& o );
84 CMHPropertiesValuesList & operator =( const CMHPropertiesValuesList& o );
88 virtual ~CMHPropertiesValuesList();
96 CSerializablePtr get(const
char *propertyName, const int64_t & hypothesis_ID ) const;
100 template <typename T>
101 typename T::
SmartPtr getAs(const
char *propertyName, const int64_t & hypothesis_ID,
bool allowNullPointer = true)
const
107 if (allowNullPointer)
108 return typename T::SmartPtr();
112 ASSERT_( class_ID == obj->GetRuntimeClass() );
113 return typename T::SmartPtr( obj );
125 void set(
const char *propertyName,
const CSerializablePtr &obj,
const int64_t & hypothesis_ID);
130 void setMemoryReference(
const char *propertyName,
const CSerializablePtr& obj,
const int64_t & hypothesis_ID);
134 void remove(
const char *propertyName,
const int64_t & hypothesis_ID);
138 void removeAll(
const int64_t & hypothesis_ID);
143 void setElemental(
const char *propertyName,
const T &data,
const int64_t & hypothesis_ID)
148 memChunk->setAllocBlockSize(10);
157 it->value = memChunk;
164 newPair.
name = std::string(propertyName);
165 newPair.
value = memChunk;
166 newPair.
ID = hypothesis_ID;
167 m_properties.push_back(newPair);
170 printf(
"Exception while setting annotation '%s'",propertyName); \
178 bool getElemental(
const char *propertyName, T &out_data,
const int64_t & hypothesis_ID,
bool raiseExceptionIfNotFound =
false)
const
193 if (raiseExceptionIfNotFound)
201 std::vector<std::string> getPropertyNames()
const;
212 size_t size()
const {
return m_properties.size(); }