modelgbp Generated OpFlex Model 1.7.0
Router.hpp
1
10#pragma once
11#ifndef GI_INV_ROUTER_HPP
12#define GI_INV_ROUTER_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
21class Router
22 : public opflex::modb::mointernal::MO
23{
24public:
25
29 static const opflex::modb::class_id_t CLASS_ID = 132;
30
35 bool isNameSet()
36 {
37 return getObjectInstance().isSet(4325377ul, opflex::modb::PropertyInfo::STRING);
38 }
39
44 boost::optional<const std::string&> getName()
45 {
46 if (isNameSet())
47 return getObjectInstance().getString(4325377ul);
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::Router& setName(const std::string& newValue)
70 {
71 getTLMutator().modify(getClassId(), getURI())->setString(4325377ul, newValue);
72 return *this;
73 }
74
82 {
83 getTLMutator().modify(getClassId(), getURI())->unset(4325377ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84 return *this;
85 }
86
98 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Router> > resolve(
99 opflex::ofcore::OFFramework& framework,
100 const opflex::modb::URI& uri)
101 {
102 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Router>(framework, CLASS_ID, uri);
103 }
104
116 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Router> > resolve(
117 const opflex::modb::URI& uri)
118 {
119 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Router>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
120 }
121
142 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Router> > resolve(
143 opflex::ofcore::OFFramework& framework,
144 const std::string& invLocalEndpointInventoryName,
145 const std::string& invLocalInventoryEpUuid,
146 const std::string& invRouterName)
147 {
148 return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvDHCPv4Config").addElement("InvRouter").addElement(invRouterName).build());
149 }
150
170 static boost::optional<OF_SHARED_PTR<modelgbp::inv::Router> > resolve(
171 const std::string& invLocalEndpointInventoryName,
172 const std::string& invLocalInventoryEpUuid,
173 const std::string& invRouterName)
174 {
175 return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invRouterName);
176 }
177
186 void remove()
187 {
188 getTLMutator().remove(CLASS_ID, getURI());
189 }
190
201 static void remove(opflex::ofcore::OFFramework& framework,
202 const opflex::modb::URI& uri)
203 {
204 MO::remove(framework, CLASS_ID, uri);
205 }
206
217 static void remove(const opflex::modb::URI& uri)
218 {
219 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
220 }
221
240 static void remove(
241 opflex::ofcore::OFFramework& framework,
242 const std::string& invLocalEndpointInventoryName,
243 const std::string& invLocalInventoryEpUuid,
244 const std::string& invRouterName)
245 {
246 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvDHCPv4Config").addElement("InvRouter").addElement(invRouterName).build());
247 }
248
267 static void remove(
268 const std::string& invLocalEndpointInventoryName,
269 const std::string& invLocalInventoryEpUuid,
270 const std::string& invRouterName)
271 {
272 remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invRouterName);
273 }
274
286 static void registerListener(
287 opflex::ofcore::OFFramework& framework,
288 opflex::modb::ObjectListener* listener)
289 {
290 opflex::modb::mointernal
291 ::MO::registerListener(framework, listener, CLASS_ID);
292 }
293
305 static void registerListener(
306 opflex::modb::ObjectListener* listener)
307 {
308 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
309 }
310
318 opflex::ofcore::OFFramework& framework,
319 opflex::modb::ObjectListener* listener)
320 {
321 opflex::modb::mointernal
322 ::MO::unregisterListener(framework, listener, CLASS_ID);
323 }
324
332 opflex::modb::ObjectListener* listener)
333 {
334 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
335 }
336
342 opflex::ofcore::OFFramework& framework,
343 const opflex::modb::URI& uri,
344 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
345 : MO(framework, CLASS_ID, uri, oi) { }
346}; // class Router
347
348} // namespace inv
349} // namespace modelgbp
350#endif // GI_INV_ROUTER_HPP
Definition Router.hpp:23
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Router from the managed object store.
Definition Router.hpp:98
void remove()
Remove this instance using the currently-active mutator.
Definition Router.hpp:186
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Router.
Definition Router.hpp:29
static void remove(const opflex::modb::URI &uri)
Remove the Router object with the specified URI using the currently-active mutator and the default fr...
Definition Router.hpp:217
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Router from the managed object store using the default framework instance.
Definition Router.hpp:116
modelgbp::inv::Router & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition Router.hpp:69
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition Router.hpp:317
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 Router.hpp:286
static void remove(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invRouterName)
Remove the Router object with the specified path elements from the managed object store using the def...
Definition Router.hpp:267
bool isNameSet()
Check whether name has been set.
Definition Router.hpp:35
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition Router.hpp:44
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition Router.hpp:331
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invRouterName)
Retrieve an instance of Router from the managed object store by constructing its URI from the path el...
Definition Router.hpp:142
modelgbp::inv::Router & unsetName()
Unset name in the currently-active mutator.
Definition Router.hpp:81
static void remove(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invRouterName)
Remove the Router object with the specified path elements from the managed object store.
Definition Router.hpp:240
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition Router.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolve(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invRouterName)
Retrieve an instance of Router from the default managed object store by constructing its URI from the...
Definition Router.hpp:170
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the Router object with the specified URI using the currently-active mutator.
Definition Router.hpp:201
Router(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Router.
Definition Router.hpp:341
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 Router.hpp:305
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12