modelgbp Generated OpFlex Model 1.7.0
Interface.hpp
1
10#pragma once
11#ifndef GI_INV_INTERFACE_HPP
12#define GI_INV_INTERFACE_HPP
13
14#include <boost/optional.hpp>
15#include "opflex/modb/URIBuilder.h"
16#include "opflex/modb/mo-internal/MO.h"
17
18namespace modelgbp {
19namespace inv {
20
22 : public opflex::modb::mointernal::MO
23{
24public:
25
29 static const opflex::modb::class_id_t CLASS_ID = 128;
30
35 bool isNameSet()
36 {
37 return getObjectInstance().isSet(4194305ul, opflex::modb::PropertyInfo::STRING);
38 }
39
44 boost::optional<const std::string&> getName()
45 {
46 if (isNameSet())
47 return getObjectInstance().getString(4194305ul);
48 return boost::none;
49 }
50
56 const std::string& getName(const std::string& defaultValue)
57 {
58 return getName().get_value_or(defaultValue);
59 }
60
69 modelgbp::inv::Interface& setName(const std::string& newValue)
70 {
71 getTLMutator().modify(getClassId(), getURI())->setString(4194305ul, newValue);
72 return *this;
73 }
74
82 {
83 getTLMutator().modify(getClassId(), getURI())->unset(4194305ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84 return *this;
85 }
86
91 bool isTypeSet()
92 {
93 return getObjectInstance().isSet(4194306ul, opflex::modb::PropertyInfo::STRING);
94 }
95
100 boost::optional<const std::string&> getType()
101 {
102 if (isTypeSet())
103 return getObjectInstance().getString(4194306ul);
104 return boost::none;
105 }
106
112 const std::string& getType(const std::string& defaultValue)
113 {
114 return getType().get_value_or(defaultValue);
115 }
116
125 modelgbp::inv::Interface& setType(const std::string& newValue)
126 {
127 getTLMutator().modify(getClassId(), getURI())->setString(4194306ul, newValue);
128 return *this;
129 }
130
138 {
139 getTLMutator().modify(getClassId(), getURI())->unset(4194306ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
140 return *this;
141 }
142
154 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Interface> > resolve(
155 opflex::ofcore::OFFramework& framework,
156 const opflex::modb::URI& uri)
157 {
158 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Interface>(framework, CLASS_ID, uri);
159 }
160
172 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Interface> > resolve(
173 const opflex::modb::URI& uri)
174 {
175 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Interface>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
176 }
177
200 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Interface> > resolve(
201 opflex::ofcore::OFFramework& framework,
202 const std::string& invLocalEndpointInventoryName,
203 const std::string& invLocalInventoryEpUuid,
204 const std::string& invInterfaceName,
205 const std::string& invInterfaceType)
206 {
207 return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvInterface").addElement(invInterfaceName).addElement(invInterfaceType).build());
208 }
209
231 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Interface> > resolve(
232 const std::string& invLocalEndpointInventoryName,
233 const std::string& invLocalInventoryEpUuid,
234 const std::string& invInterfaceName,
235 const std::string& invInterfaceType)
236 {
237 return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invInterfaceName,invInterfaceType);
238 }
239
248 void remove()
249 {
250 getTLMutator().remove(CLASS_ID, getURI());
251 }
252
263 static void remove(opflex::ofcore::OFFramework& framework,
264 const opflex::modb::URI& uri)
265 {
266 MO::remove(framework, CLASS_ID, uri);
267 }
268
279 static void remove(const opflex::modb::URI& uri)
280 {
281 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
282 }
283
304 static void remove(
305 opflex::ofcore::OFFramework& framework,
306 const std::string& invLocalEndpointInventoryName,
307 const std::string& invLocalInventoryEpUuid,
308 const std::string& invInterfaceName,
309 const std::string& invInterfaceType)
310 {
311 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvInterface").addElement(invInterfaceName).addElement(invInterfaceType).build());
312 }
313
334 static void remove(
335 const std::string& invLocalEndpointInventoryName,
336 const std::string& invLocalInventoryEpUuid,
337 const std::string& invInterfaceName,
338 const std::string& invInterfaceType)
339 {
340 remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invInterfaceName,invInterfaceType);
341 }
342
354 static void registerListener(
355 opflex::ofcore::OFFramework& framework,
356 opflex::modb::ObjectListener* listener)
357 {
358 opflex::modb::mointernal
359 ::MO::registerListener(framework, listener, CLASS_ID);
360 }
361
373 static void registerListener(
374 opflex::modb::ObjectListener* listener)
375 {
376 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
377 }
378
386 opflex::ofcore::OFFramework& framework,
387 opflex::modb::ObjectListener* listener)
388 {
389 opflex::modb::mointernal
390 ::MO::unregisterListener(framework, listener, CLASS_ID);
391 }
392
400 opflex::modb::ObjectListener* listener)
401 {
402 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
403 }
404
410 opflex::ofcore::OFFramework& framework,
411 const opflex::modb::URI& uri,
412 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
413 : MO(framework, CLASS_ID, uri, oi) { }
414}; // class Interface
415
416} // namespace inv
417} // namespace modelgbp
418#endif // GI_INV_INTERFACE_HPP
Definition Interface.hpp:23
bool isNameSet()
Check whether name has been set.
Definition Interface.hpp:35
bool isTypeSet()
Check whether type has been set.
Definition Interface.hpp:91
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition Interface.hpp:44
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the Interface object with the specified URI using the currently-active mutator.
Definition Interface.hpp:263
modelgbp::inv::Interface & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition Interface.hpp:69
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Interface > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Interface from the managed object store using the default framework instance.
Definition Interface.hpp:172
void remove()
Remove this instance using the currently-active mutator.
Definition Interface.hpp:248
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition Interface.hpp:399
modelgbp::inv::Interface & setType(const std::string &newValue)
Set type to the specified value in the currently-active mutator.
Definition Interface.hpp:125
static void remove(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invInterfaceName, const std::string &invInterfaceType)
Remove the Interface object with the specified path elements from the managed object store using the ...
Definition Interface.hpp:334
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Interface > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invInterfaceName, const std::string &invInterfaceType)
Retrieve an instance of Interface from the managed object store by constructing its URI from the path...
Definition Interface.hpp:200
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 Interface.hpp:373
const std::string & getType(const std::string &defaultValue)
Get the value of type if set, otherwise the value of default passed in.
Definition Interface.hpp:112
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Interface > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Interface from the managed object store.
Definition Interface.hpp:154
static void remove(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invInterfaceName, const std::string &invInterfaceType)
Remove the Interface object with the specified path elements from the managed object store.
Definition Interface.hpp:304
static void remove(const opflex::modb::URI &uri)
Remove the Interface object with the specified URI using the currently-active mutator and the default...
Definition Interface.hpp:279
boost::optional< const std::string & > getType()
Get the value of type if it has been set.
Definition Interface.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Interface > > resolve(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invInterfaceName, const std::string &invInterfaceType)
Retrieve an instance of Interface from the default managed object store by constructing its URI from ...
Definition Interface.hpp:231
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition Interface.hpp:385
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 Interface.hpp:354
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition Interface.hpp:56
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Interface.
Definition Interface.hpp:29
modelgbp::inv::Interface & unsetType()
Unset type in the currently-active mutator.
Definition Interface.hpp:137
Interface(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Interface.
Definition Interface.hpp:409
modelgbp::inv::Interface & unsetName()
Unset name in the currently-active mutator.
Definition Interface.hpp:81
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12