modelgbp Generated OpFlex Model  1.7.0
SecurityGroupContext.hpp
1 
10 #pragma once
11 #ifndef GI_EPR_SECURITYGROUPCONTEXT_HPP
12 #define GI_EPR_SECURITYGROUPCONTEXT_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 
18 namespace modelgbp {
19 namespace epr {
20 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 98;
30 
35  bool isNameSet()
36  {
37  return getObjectInstance().isSet(3211265ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getName()
45  {
46  if (isNameSet())
47  return getObjectInstance().getString(3211265ul);
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::epr::SecurityGroupContext& setName(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(3211265ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(3211265ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
92  {
93  return getObjectInstance().isSet(3211266ul, opflex::modb::PropertyInfo::STRING);
94  }
95 
100  boost::optional<const std::string&> getSecGroup()
101  {
102  if (isSecGroupSet())
103  return getObjectInstance().getString(3211266ul);
104  return boost::none;
105  }
106 
112  const std::string& getSecGroup(const std::string& defaultValue)
113  {
114  return getSecGroup().get_value_or(defaultValue);
115  }
116 
125  modelgbp::epr::SecurityGroupContext& setSecGroup(const std::string& newValue)
126  {
127  getTLMutator().modify(getClassId(), getURI())->setString(3211266ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(3211266ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
154  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
155  opflex::ofcore::OFFramework& framework,
156  const opflex::modb::URI& uri)
157  {
158  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::SecurityGroupContext>(framework, CLASS_ID, uri);
159  }
160 
172  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
173  const opflex::modb::URI& uri)
174  {
175  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::SecurityGroupContext>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
176  }
177 
198  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
199  opflex::ofcore::OFFramework& framework,
200  const std::string& eprL2EpContext,
201  const opflex::modb::MAC& eprL2EpMac,
202  const std::string& eprSecurityGroupContextSecGroup)
203  {
204  return resolve(framework,opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement("EprSecurityGroupContext").addElement(eprSecurityGroupContextSecGroup).build());
205  }
206 
226  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
227  const std::string& eprL2EpContext,
228  const opflex::modb::MAC& eprL2EpMac,
229  const std::string& eprSecurityGroupContextSecGroup)
230  {
231  return resolve(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprSecurityGroupContextSecGroup);
232  }
233 
254  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
255  opflex::ofcore::OFFramework& framework,
256  const std::string& eprL3EpContext,
257  const std::string& eprL3EpIp,
258  const std::string& eprSecurityGroupContextSecGroup)
259  {
260  return resolve(framework,opflex::modb::URIBuilder().addElement("EprL3Universe").addElement("EprL3Ep").addElement(eprL3EpContext).addElement(eprL3EpIp).addElement("EprSecurityGroupContext").addElement(eprSecurityGroupContextSecGroup).build());
261  }
262 
282  static boost::optional<OF_SHARED_PTR<modelgbp::epr::SecurityGroupContext> > resolve(
283  const std::string& eprL3EpContext,
284  const std::string& eprL3EpIp,
285  const std::string& eprSecurityGroupContextSecGroup)
286  {
287  return resolve(opflex::ofcore::OFFramework::defaultInstance(),eprL3EpContext,eprL3EpIp,eprSecurityGroupContextSecGroup);
288  }
289 
298  void remove()
299  {
300  getTLMutator().remove(CLASS_ID, getURI());
301  }
302 
313  static void remove(opflex::ofcore::OFFramework& framework,
314  const opflex::modb::URI& uri)
315  {
316  MO::remove(framework, CLASS_ID, uri);
317  }
318 
329  static void remove(const opflex::modb::URI& uri)
330  {
331  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
332  }
333 
352  static void remove(
353  opflex::ofcore::OFFramework& framework,
354  const std::string& eprL2EpContext,
355  const opflex::modb::MAC& eprL2EpMac,
356  const std::string& eprSecurityGroupContextSecGroup)
357  {
358  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement("EprSecurityGroupContext").addElement(eprSecurityGroupContextSecGroup).build());
359  }
360 
379  static void remove(
380  const std::string& eprL2EpContext,
381  const opflex::modb::MAC& eprL2EpMac,
382  const std::string& eprSecurityGroupContextSecGroup)
383  {
384  remove(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprSecurityGroupContextSecGroup);
385  }
386 
405  static void remove(
406  opflex::ofcore::OFFramework& framework,
407  const std::string& eprL3EpContext,
408  const std::string& eprL3EpIp,
409  const std::string& eprSecurityGroupContextSecGroup)
410  {
411  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("EprL3Universe").addElement("EprL3Ep").addElement(eprL3EpContext).addElement(eprL3EpIp).addElement("EprSecurityGroupContext").addElement(eprSecurityGroupContextSecGroup).build());
412  }
413 
432  static void remove(
433  const std::string& eprL3EpContext,
434  const std::string& eprL3EpIp,
435  const std::string& eprSecurityGroupContextSecGroup)
436  {
437  remove(opflex::ofcore::OFFramework::defaultInstance(),eprL3EpContext,eprL3EpIp,eprSecurityGroupContextSecGroup);
438  }
439 
451  static void registerListener(
452  opflex::ofcore::OFFramework& framework,
453  opflex::modb::ObjectListener* listener)
454  {
455  opflex::modb::mointernal
456  ::MO::registerListener(framework, listener, CLASS_ID);
457  }
458 
470  static void registerListener(
471  opflex::modb::ObjectListener* listener)
472  {
473  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
474  }
475 
482  static void unregisterListener(
483  opflex::ofcore::OFFramework& framework,
484  opflex::modb::ObjectListener* listener)
485  {
486  opflex::modb::mointernal
487  ::MO::unregisterListener(framework, listener, CLASS_ID);
488  }
489 
496  static void unregisterListener(
497  opflex::modb::ObjectListener* listener)
498  {
499  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
500  }
501 
507  opflex::ofcore::OFFramework& framework,
508  const opflex::modb::URI& uri,
509  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
510  : MO(framework, CLASS_ID, uri, oi) { }
511 }; // class SecurityGroupContext
512 
513 } // namespace epr
514 } // namespace modelgbp
515 #endif // GI_EPR_SECURITYGROUPCONTEXT_HPP
modelgbp::epr::SecurityGroupContext & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SecurityGroupContext.hpp:69
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SecurityGroupContext.hpp:44
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(opflex::ofcore::OFFramework &framework, const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac, const std::string &eprSecurityGroupContextSecGroup)
Retrieve an instance of SecurityGroupContext from the managed object store by constructing its URI fr...
Definition: SecurityGroupContext.hpp:198
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecurityGroupContext from the managed object store.
Definition: SecurityGroupContext.hpp:154
bool isSecGroupSet()
Check whether secGroup has been set.
Definition: SecurityGroupContext.hpp:91
bool isNameSet()
Check whether name has been set.
Definition: SecurityGroupContext.hpp:35
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SecurityGroupContext.
Definition: SecurityGroupContext.hpp:29
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SecurityGroupContext from the managed object store using the default framewor...
Definition: SecurityGroupContext.hpp:172
modelgbp::epr::SecurityGroupContext & unsetName()
Unset name in the currently-active mutator.
Definition: SecurityGroupContext.hpp:81
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: SecurityGroupContext.hpp:470
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SecurityGroupContext.hpp:482
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac, const std::string &eprSecurityGroupContextSecGroup)
Retrieve an instance of SecurityGroupContext from the default managed object store by constructing it...
Definition: SecurityGroupContext.hpp:226
SecurityGroupContext(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SecurityGroupContext.
Definition: SecurityGroupContext.hpp:506
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SecurityGroupContext.hpp:496
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: SecurityGroupContext.hpp:451
const std::string & getSecGroup(const std::string &defaultValue)
Get the value of secGroup if set, otherwise the value of default passed in.
Definition: SecurityGroupContext.hpp:112
Definition: SecurityGroupContext.hpp:21
modelgbp::epr::SecurityGroupContext & setSecGroup(const std::string &newValue)
Set secGroup to the specified value in the currently-active mutator.
Definition: SecurityGroupContext.hpp:125
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(opflex::ofcore::OFFramework &framework, const std::string &eprL3EpContext, const std::string &eprL3EpIp, const std::string &eprSecurityGroupContextSecGroup)
Retrieve an instance of SecurityGroupContext from the managed object store by constructing its URI fr...
Definition: SecurityGroupContext.hpp:254
static boost::optional< OF_SHARED_PTR< modelgbp::epr::SecurityGroupContext > > resolve(const std::string &eprL3EpContext, const std::string &eprL3EpIp, const std::string &eprSecurityGroupContextSecGroup)
Retrieve an instance of SecurityGroupContext from the default managed object store by constructing it...
Definition: SecurityGroupContext.hpp:282
modelgbp::epr::SecurityGroupContext & unsetSecGroup()
Unset secGroup in the currently-active mutator.
Definition: SecurityGroupContext.hpp:137
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SecurityGroupContext.hpp:56
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
boost::optional< const std::string & > getSecGroup()
Get the value of secGroup if it has been set.
Definition: SecurityGroupContext.hpp:100