modelgbp Generated OpFlex Model 1.7.0
ExternalSubnet.hpp
1
10#pragma once
11#ifndef GI_GBP_EXTERNALSUBNET_HPP
12#define GI_GBP_EXTERNALSUBNET_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 gbp {
20
22 : public opflex::modb::mointernal::MO
23{
24public:
25
29 static const opflex::modb::class_id_t CLASS_ID = 179;
30
36 {
37 return getObjectInstance().isSet(5865474ul, opflex::modb::PropertyInfo::STRING);
38 }
39
44 boost::optional<const std::string&> getAddress()
45 {
46 if (isAddressSet())
47 return getObjectInstance().getString(5865474ul);
48 return boost::none;
49 }
50
56 const std::string& getAddress(const std::string& defaultValue)
57 {
58 return getAddress().get_value_or(defaultValue);
59 }
60
69 modelgbp::gbp::ExternalSubnet& setAddress(const std::string& newValue)
70 {
71 getTLMutator().modify(getClassId(), getURI())->setString(5865474ul, newValue);
72 return *this;
73 }
74
82 {
83 getTLMutator().modify(getClassId(), getURI())->unset(5865474ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84 return *this;
85 }
86
91 bool isNameSet()
92 {
93 return getObjectInstance().isSet(5865473ul, opflex::modb::PropertyInfo::STRING);
94 }
95
100 boost::optional<const std::string&> getName()
101 {
102 if (isNameSet())
103 return getObjectInstance().getString(5865473ul);
104 return boost::none;
105 }
106
112 const std::string& getName(const std::string& defaultValue)
113 {
114 return getName().get_value_or(defaultValue);
115 }
116
125 modelgbp::gbp::ExternalSubnet& setName(const std::string& newValue)
126 {
127 getTLMutator().modify(getClassId(), getURI())->setString(5865473ul, newValue);
128 return *this;
129 }
130
138 {
139 getTLMutator().modify(getClassId(), getURI())->unset(5865473ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
140 return *this;
141 }
142
148 {
149 return getObjectInstance().isSet(5865475ul, opflex::modb::PropertyInfo::U64);
150 }
151
156 boost::optional<const uint8_t> getPrefixLen()
157 {
158 if (isPrefixLenSet())
159 return (const uint8_t)getObjectInstance().getUInt64(5865475ul);
160 return boost::none;
161 }
162
168 const uint8_t getPrefixLen(const uint8_t defaultValue)
169 {
170 return getPrefixLen().get_value_or(defaultValue);
171 }
172
182 {
183 getTLMutator().modify(getClassId(), getURI())->setUInt64(5865475ul, newValue);
184 return *this;
185 }
186
194 {
195 getTLMutator().modify(getClassId(), getURI())->unset(5865475ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
196 return *this;
197 }
198
210 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::ExternalSubnet> > resolve(
211 opflex::ofcore::OFFramework& framework,
212 const opflex::modb::URI& uri)
213 {
214 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::ExternalSubnet>(framework, CLASS_ID, uri);
215 }
216
228 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::ExternalSubnet> > resolve(
229 const opflex::modb::URI& uri)
230 {
231 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::ExternalSubnet>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232 }
233
258 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::ExternalSubnet> > resolve(
259 opflex::ofcore::OFFramework& framework,
260 const std::string& policySpaceName,
261 const std::string& gbpRoutingDomainName,
262 const std::string& gbpL3ExternalDomainName,
263 const std::string& gbpL3ExternalNetworkName,
264 const std::string& gbpExternalSubnetName)
265 {
266 return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("GbpL3ExternalDomain").addElement(gbpL3ExternalDomainName).addElement("GbpL3ExternalNetwork").addElement(gbpL3ExternalNetworkName).addElement("GbpExternalSubnet").addElement(gbpExternalSubnetName).build());
267 }
268
292 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::ExternalSubnet> > resolve(
293 const std::string& policySpaceName,
294 const std::string& gbpRoutingDomainName,
295 const std::string& gbpL3ExternalDomainName,
296 const std::string& gbpL3ExternalNetworkName,
297 const std::string& gbpExternalSubnetName)
298 {
299 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,gbpL3ExternalDomainName,gbpL3ExternalNetworkName,gbpExternalSubnetName);
300 }
301
310 void remove()
311 {
312 getTLMutator().remove(CLASS_ID, getURI());
313 }
314
325 static void remove(opflex::ofcore::OFFramework& framework,
326 const opflex::modb::URI& uri)
327 {
328 MO::remove(framework, CLASS_ID, uri);
329 }
330
341 static void remove(const opflex::modb::URI& uri)
342 {
343 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
344 }
345
368 static void remove(
369 opflex::ofcore::OFFramework& framework,
370 const std::string& policySpaceName,
371 const std::string& gbpRoutingDomainName,
372 const std::string& gbpL3ExternalDomainName,
373 const std::string& gbpL3ExternalNetworkName,
374 const std::string& gbpExternalSubnetName)
375 {
376 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("GbpL3ExternalDomain").addElement(gbpL3ExternalDomainName).addElement("GbpL3ExternalNetwork").addElement(gbpL3ExternalNetworkName).addElement("GbpExternalSubnet").addElement(gbpExternalSubnetName).build());
377 }
378
401 static void remove(
402 const std::string& policySpaceName,
403 const std::string& gbpRoutingDomainName,
404 const std::string& gbpL3ExternalDomainName,
405 const std::string& gbpL3ExternalNetworkName,
406 const std::string& gbpExternalSubnetName)
407 {
408 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,gbpL3ExternalDomainName,gbpL3ExternalNetworkName,gbpExternalSubnetName);
409 }
410
422 static void registerListener(
423 opflex::ofcore::OFFramework& framework,
424 opflex::modb::ObjectListener* listener)
425 {
426 opflex::modb::mointernal
427 ::MO::registerListener(framework, listener, CLASS_ID);
428 }
429
441 static void registerListener(
442 opflex::modb::ObjectListener* listener)
443 {
444 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
445 }
446
454 opflex::ofcore::OFFramework& framework,
455 opflex::modb::ObjectListener* listener)
456 {
457 opflex::modb::mointernal
458 ::MO::unregisterListener(framework, listener, CLASS_ID);
459 }
460
468 opflex::modb::ObjectListener* listener)
469 {
470 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
471 }
472
478 opflex::ofcore::OFFramework& framework,
479 const opflex::modb::URI& uri,
480 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
481 : MO(framework, CLASS_ID, uri, oi) { }
482}; // class ExternalSubnet
483
484} // namespace gbp
485} // namespace modelgbp
486#endif // GI_GBP_EXTERNALSUBNET_HPP
Definition ExternalSubnet.hpp:23
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::ExternalSubnet > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of ExternalSubnet from the managed object store.
Definition ExternalSubnet.hpp:210
bool isPrefixLenSet()
Check whether prefixLen has been set.
Definition ExternalSubnet.hpp:147
bool isNameSet()
Check whether name has been set.
Definition ExternalSubnet.hpp:91
const std::string & getAddress(const std::string &defaultValue)
Get the value of address if set, otherwise the value of default passed in.
Definition ExternalSubnet.hpp:56
const uint8_t getPrefixLen(const uint8_t defaultValue)
Get the value of prefixLen if set, otherwise the value of default passed in.
Definition ExternalSubnet.hpp:168
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::ExternalSubnet > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of ExternalSubnet from the managed object store using the default framework inst...
Definition ExternalSubnet.hpp:228
modelgbp::gbp::ExternalSubnet & setAddress(const std::string &newValue)
Set address to the specified value in the currently-active mutator.
Definition ExternalSubnet.hpp:69
modelgbp::gbp::ExternalSubnet & unsetAddress()
Unset address in the currently-active mutator.
Definition ExternalSubnet.hpp:81
modelgbp::gbp::ExternalSubnet & setPrefixLen(const uint8_t newValue)
Set prefixLen to the specified value in the currently-active mutator.
Definition ExternalSubnet.hpp:181
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 ExternalSubnet.hpp:441
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 ExternalSubnet.hpp:422
static void remove(const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &gbpL3ExternalDomainName, const std::string &gbpL3ExternalNetworkName, const std::string &gbpExternalSubnetName)
Remove the ExternalSubnet object with the specified path elements from the managed object store using...
Definition ExternalSubnet.hpp:401
boost::optional< const std::string & > getAddress()
Get the value of address if it has been set.
Definition ExternalSubnet.hpp:44
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition ExternalSubnet.hpp:467
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::ExternalSubnet > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &gbpL3ExternalDomainName, const std::string &gbpL3ExternalNetworkName, const std::string &gbpExternalSubnetName)
Retrieve an instance of ExternalSubnet from the managed object store by constructing its URI from the...
Definition ExternalSubnet.hpp:258
modelgbp::gbp::ExternalSubnet & unsetName()
Unset name in the currently-active mutator.
Definition ExternalSubnet.hpp:137
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition ExternalSubnet.hpp:453
static void remove(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &gbpL3ExternalDomainName, const std::string &gbpL3ExternalNetworkName, const std::string &gbpExternalSubnetName)
Remove the ExternalSubnet object with the specified path elements from the managed object store.
Definition ExternalSubnet.hpp:368
ExternalSubnet(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of ExternalSubnet.
Definition ExternalSubnet.hpp:477
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for ExternalSubnet.
Definition ExternalSubnet.hpp:29
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition ExternalSubnet.hpp:112
boost::optional< const uint8_t > getPrefixLen()
Get the value of prefixLen if it has been set.
Definition ExternalSubnet.hpp:156
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::ExternalSubnet > > resolve(const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &gbpL3ExternalDomainName, const std::string &gbpL3ExternalNetworkName, const std::string &gbpExternalSubnetName)
Retrieve an instance of ExternalSubnet from the default managed object store by constructing its URI ...
Definition ExternalSubnet.hpp:292
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the ExternalSubnet object with the specified URI using the currently-active mutator.
Definition ExternalSubnet.hpp:325
bool isAddressSet()
Check whether address has been set.
Definition ExternalSubnet.hpp:35
void remove()
Remove this instance using the currently-active mutator.
Definition ExternalSubnet.hpp:310
static void remove(const opflex::modb::URI &uri)
Remove the ExternalSubnet object with the specified URI using the currently-active mutator and the de...
Definition ExternalSubnet.hpp:341
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition ExternalSubnet.hpp:100
modelgbp::gbp::ExternalSubnet & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition ExternalSubnet.hpp:125
modelgbp::gbp::ExternalSubnet & unsetPrefixLen()
Unset prefixLen in the currently-active mutator.
Definition ExternalSubnet.hpp:193
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12