11 #ifndef GI_GBPE_EPATTRIBUTE_HPP
12 #define GI_GBPE_EPATTRIBUTE_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
22 :
public opflex::modb::mointernal::MO
29 static const opflex::modb::class_id_t
CLASS_ID = 28;
37 return getObjectInstance().isSet(917505ul, opflex::modb::PropertyInfo::STRING);
44 boost::optional<const std::string&>
getName()
47 return getObjectInstance().getString(917505ul);
56 const std::string&
getName(
const std::string& defaultValue)
58 return getName().get_value_or(defaultValue);
71 getTLMutator().modify(getClassId(), getURI())->setString(917505ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(917505ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(917506ul, opflex::modb::PropertyInfo::STRING);
103 return getObjectInstance().getString(917506ul);
112 const std::string&
getValue(
const std::string& defaultValue)
114 return getValue().get_value_or(defaultValue);
127 getTLMutator().modify(getClassId(), getURI())->setString(917506ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(917506ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
154 static boost::optional<boost::shared_ptr<modelgbp::gbpe::EpAttribute> >
resolve(
155 opflex::ofcore::OFFramework& framework,
156 const opflex::modb::URI& uri)
158 return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::EpAttribute>(framework,
CLASS_ID, uri);
172 static boost::optional<boost::shared_ptr<modelgbp::gbpe::EpAttribute> >
resolve(
173 const opflex::modb::URI& uri)
175 return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::EpAttribute>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
196 static boost::optional<boost::shared_ptr<modelgbp::gbpe::EpAttribute> >
resolve(
197 opflex::ofcore::OFFramework& framework,
198 const std::string& gbpeEpAttributeSetUuid,
199 const std::string& gbpeEpAttributeName)
201 return resolve(framework,opflex::modb::URIBuilder().addElement(
"GbpeVMUniverse").addElement(
"GbpeEpAttributeSet").addElement(gbpeEpAttributeSetUuid).addElement(
"GbpeEpAttribute").addElement(gbpeEpAttributeName).build());
221 static boost::optional<boost::shared_ptr<modelgbp::gbpe::EpAttribute> >
resolve(
222 const std::string& gbpeEpAttributeSetUuid,
223 const std::string& gbpeEpAttributeName)
225 return resolve(opflex::ofcore::OFFramework::defaultInstance(),gbpeEpAttributeSetUuid,gbpeEpAttributeName);
238 getTLMutator().remove(
CLASS_ID, getURI());
251 static void remove(opflex::ofcore::OFFramework& framework,
252 const opflex::modb::URI& uri)
254 MO::remove(framework,
CLASS_ID, uri);
267 static void remove(
const opflex::modb::URI& uri)
269 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
289 opflex::ofcore::OFFramework& framework,
290 const std::string& gbpeEpAttributeSetUuid,
291 const std::string& gbpeEpAttributeName)
293 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"GbpeVMUniverse").addElement(
"GbpeEpAttributeSet").addElement(gbpeEpAttributeSetUuid).addElement(
"GbpeEpAttribute").addElement(gbpeEpAttributeName).build());
313 const std::string& gbpeEpAttributeSetUuid,
314 const std::string& gbpeEpAttributeName)
316 remove(opflex::ofcore::OFFramework::defaultInstance(),gbpeEpAttributeSetUuid,gbpeEpAttributeName);
331 opflex::ofcore::OFFramework& framework,
332 opflex::modb::ObjectListener* listener)
334 opflex::modb::mointernal
335 ::MO::registerListener(framework, listener,
CLASS_ID);
350 opflex::modb::ObjectListener* listener)
362 opflex::ofcore::OFFramework& framework,
363 opflex::modb::ObjectListener* listener)
365 opflex::modb::mointernal
366 ::MO::unregisterListener(framework, listener,
CLASS_ID);
376 opflex::modb::ObjectListener* listener)
386 opflex::ofcore::OFFramework& framework,
387 const opflex::modb::URI& uri,
388 const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
389 : MO(framework,
CLASS_ID, uri, oi) { }
394 #endif // GI_GBPE_EPATTRIBUTE_HPP
bool isValueSet()
Check whether value has been set.
Definition: EpAttribute.hpp:91
modelgbp::gbpe::EpAttribute & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: EpAttribute.hpp:69
EpAttribute(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of EpAttribute.
Definition: EpAttribute.hpp:385
boost::optional< const std::string & > getValue()
Get the value of value if it has been set.
Definition: EpAttribute.hpp:100
static boost::optional< boost::shared_ptr< modelgbp::gbpe::EpAttribute > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of EpAttribute from the managed object store using the default framework instanc...
Definition: EpAttribute.hpp:172
modelgbp::gbpe::EpAttribute & unsetName()
Unset name in the currently-active mutator.
Definition: EpAttribute.hpp:81
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: EpAttribute.hpp:375
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: EpAttribute.hpp:44
static boost::optional< boost::shared_ptr< modelgbp::gbpe::EpAttribute > > resolve(opflex::ofcore::OFFramework &framework, const std::string &gbpeEpAttributeSetUuid, const std::string &gbpeEpAttributeName)
Retrieve an instance of EpAttribute from the managed object store by constructing its URI from the pa...
Definition: EpAttribute.hpp:196
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: EpAttribute.hpp:361
modelgbp::gbpe::EpAttribute & unsetValue()
Unset value in the currently-active mutator.
Definition: EpAttribute.hpp:137
modelgbp::gbpe::EpAttribute & setValue(const std::string &newValue)
Set value to the specified value in the currently-active mutator.
Definition: EpAttribute.hpp:125
static boost::optional< boost::shared_ptr< modelgbp::gbpe::EpAttribute > > resolve(const std::string &gbpeEpAttributeSetUuid, const std::string &gbpeEpAttributeName)
Retrieve an instance of EpAttribute from the default managed object store by constructing its URI fro...
Definition: EpAttribute.hpp:221
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for EpAttribute.
Definition: EpAttribute.hpp:29
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: EpAttribute.hpp:349
static boost::optional< boost::shared_ptr< modelgbp::gbpe::EpAttribute > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpAttribute from the managed object store.
Definition: EpAttribute.hpp:154
static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: EpAttribute.hpp:330
bool isNameSet()
Check whether name has been set.
Definition: EpAttribute.hpp:35
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: EpAttribute.hpp:56
Definition: EpAttribute.hpp:21
const std::string & getValue(const std::string &defaultValue)
Get the value of value if set, otherwise the value of default passed in.
Definition: EpAttribute.hpp:112