modelgbp Generated OpFlex Model  1.3.0
SecGroup.hpp
1 
10 #pragma once
11 #ifndef GI_GBP_SECGROUP_HPP
12 #define GI_GBP_SECGROUP_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 /*
18  * contains: item:mclass(epdr/EndPointFromSecGroupRTgt)
19  */
20 #include "modelgbp/epdr/EndPointFromSecGroupRTgt.hpp"
21 /*
22  * contains: item:mclass(gbp/SecGroupSubject)
23  */
24 #include "modelgbp/gbp/SecGroupSubject.hpp"
25 
26 namespace modelgbp {
27 namespace gbp {
28 
29 class SecGroup
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 159;
38 
43  bool isNameSet()
44  {
45  return getObjectInstance().isSet(5210113ul, opflex::modb::PropertyInfo::STRING);
46  }
47 
52  boost::optional<const std::string&> getName()
53  {
54  if (isNameSet())
55  return getObjectInstance().getString(5210113ul);
56  return boost::none;
57  }
58 
64  const std::string& getName(const std::string& defaultValue)
65  {
66  return getName().get_value_or(defaultValue);
67  }
68 
77  modelgbp::gbp::SecGroup& setName(const std::string& newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setString(5210113ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(5210113ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
106  static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> > resolve(
107  opflex::ofcore::OFFramework& framework,
108  const opflex::modb::URI& uri)
109  {
110  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroup>(framework, CLASS_ID, uri);
111  }
112 
124  static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> > resolve(
125  const opflex::modb::URI& uri)
126  {
127  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroup>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
128  }
129 
148  static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> > resolve(
149  opflex::ofcore::OFFramework& framework,
150  const std::string& policySpaceName,
151  const std::string& gbpSecGroupName)
152  {
153  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpSecGroup").addElement(gbpSecGroupName).build());
154  }
155 
173  static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> > resolve(
174  const std::string& policySpaceName,
175  const std::string& gbpSecGroupName)
176  {
177  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName);
178  }
179 
191  boost::optional<boost::shared_ptr<modelgbp::epdr::EndPointFromSecGroupRTgt> > resolveEpdrEndPointFromSecGroupRTgt(
192  const std::string& epdrEndPointFromSecGroupRTgtSource)
193  {
194  return modelgbp::epdr::EndPointFromSecGroupRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("EpdrEndPointFromSecGroupRTgt").addElement(epdrEndPointFromSecGroupRTgtSource).build());
195  }
196 
209  boost::shared_ptr<modelgbp::epdr::EndPointFromSecGroupRTgt> addEpdrEndPointFromSecGroupRTgt(
210  const std::string& epdrEndPointFromSecGroupRTgtSource)
211  {
212  boost::shared_ptr<modelgbp::epdr::EndPointFromSecGroupRTgt> result = addChild<modelgbp::epdr::EndPointFromSecGroupRTgt>(
213  CLASS_ID, getURI(), 2152693850ul, 90,
214  opflex::modb::URIBuilder(getURI()).addElement("EpdrEndPointFromSecGroupRTgt").addElement(epdrEndPointFromSecGroupRTgtSource).build()
215  );
216  result->setSource(epdrEndPointFromSecGroupRTgtSource);
217  return result;
218  }
219 
234  void resolveEpdrEndPointFromSecGroupRTgt(/* out */ std::vector<boost::shared_ptr<modelgbp::epdr::EndPointFromSecGroupRTgt> >& out)
235  {
236  opflex::modb::mointernal::MO::resolveChildren<modelgbp::epdr::EndPointFromSecGroupRTgt>(
237  getFramework(), CLASS_ID, getURI(), 2152693850ul, 90, out);
238  }
239 
251  boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroupSubject> > resolveGbpSecGroupSubject(
252  const std::string& gbpSecGroupSubjectName)
253  {
254  return modelgbp::gbp::SecGroupSubject::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).build());
255  }
256 
269  boost::shared_ptr<modelgbp::gbp::SecGroupSubject> addGbpSecGroupSubject(
270  const std::string& gbpSecGroupSubjectName)
271  {
272  boost::shared_ptr<modelgbp::gbp::SecGroupSubject> result = addChild<modelgbp::gbp::SecGroupSubject>(
273  CLASS_ID, getURI(), 2152693920ul, 160,
274  opflex::modb::URIBuilder(getURI()).addElement("GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).build()
275  );
276  result->setName(gbpSecGroupSubjectName);
277  return result;
278  }
279 
294  void resolveGbpSecGroupSubject(/* out */ std::vector<boost::shared_ptr<modelgbp::gbp::SecGroupSubject> >& out)
295  {
296  opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::SecGroupSubject>(
297  getFramework(), CLASS_ID, getURI(), 2152693920ul, 160, out);
298  }
299 
308  void remove()
309  {
310  getTLMutator().remove(CLASS_ID, getURI());
311  }
312 
323  static void remove(opflex::ofcore::OFFramework& framework,
324  const opflex::modb::URI& uri)
325  {
326  MO::remove(framework, CLASS_ID, uri);
327  }
328 
339  static void remove(const opflex::modb::URI& uri)
340  {
341  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
342  }
343 
360  static void remove(
361  opflex::ofcore::OFFramework& framework,
362  const std::string& policySpaceName,
363  const std::string& gbpSecGroupName)
364  {
365  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpSecGroup").addElement(gbpSecGroupName).build());
366  }
367 
384  static void remove(
385  const std::string& policySpaceName,
386  const std::string& gbpSecGroupName)
387  {
388  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName);
389  }
390 
402  static void registerListener(
403  opflex::ofcore::OFFramework& framework,
404  opflex::modb::ObjectListener* listener)
405  {
406  opflex::modb::mointernal
407  ::MO::registerListener(framework, listener, CLASS_ID);
408  }
409 
421  static void registerListener(
422  opflex::modb::ObjectListener* listener)
423  {
424  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
425  }
426 
433  static void unregisterListener(
434  opflex::ofcore::OFFramework& framework,
435  opflex::modb::ObjectListener* listener)
436  {
437  opflex::modb::mointernal
438  ::MO::unregisterListener(framework, listener, CLASS_ID);
439  }
440 
447  static void unregisterListener(
448  opflex::modb::ObjectListener* listener)
449  {
450  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
451  }
452 
458  opflex::ofcore::OFFramework& framework,
459  const opflex::modb::URI& uri,
460  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
461  : MO(framework, CLASS_ID, uri, oi) { }
462 }; // class SecGroup
463 
464 } // namespace gbp
465 } // namespace modelgbp
466 #endif // GI_GBP_SECGROUP_HPP
SecGroup(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SecGroup.
Definition: SecGroup.hpp:457
boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > addEpdrEndPointFromSecGroupRTgt(const std::string &epdrEndPointFromSecGroupRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroup.hpp:209
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroup from the managed object store.
Definition: SecGroup.hpp:106
boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > resolveEpdrEndPointFromSecGroupRTgt(const std::string &epdrEndPointFromSecGroupRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: SecGroup.hpp:191
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SecGroup.
Definition: SecGroup.hpp:37
boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > resolveGbpSecGroupSubject(const std::string &gbpSecGroupSubjectName)
Retrieve the child object with the specified naming properties.
Definition: SecGroup.hpp:251
modelgbp::gbp::SecGroup & unsetName()
Unset name in the currently-active mutator.
Definition: SecGroup.hpp:89
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SecGroup.hpp:433
static boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EndPointFromSecGroupRTgt from the managed object store.
Definition: EndPointFromSecGroupRTgt.hpp:210
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SecGroup.hpp:447
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: SecGroup.hpp:402
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(const std::string &policySpaceName, const std::string &gbpSecGroupName)
Retrieve an instance of SecGroup from the default managed object store by constructing its URI from t...
Definition: SecGroup.hpp:173
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SecGroup.hpp:52
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSecGroupName)
Retrieve an instance of SecGroup from the managed object store by constructing its URI from the path ...
Definition: SecGroup.hpp:148
boost::shared_ptr< modelgbp::gbp::SecGroupSubject > addGbpSecGroupSubject(const std::string &gbpSecGroupSubjectName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroup.hpp:269
Definition: SecGroup.hpp:29
bool isNameSet()
Check whether name has been set.
Definition: SecGroup.hpp:43
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SecGroup.hpp:64
void resolveGbpSecGroupSubject(std::vector< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::SecGroupSubject.
Definition: SecGroup.hpp:294
modelgbp::gbp::SecGroup & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SecGroup.hpp:77
void resolveEpdrEndPointFromSecGroupRTgt(std::vector< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::epdr::EndPointFromSecGroupRTgt.
Definition: SecGroup.hpp:234
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SecGroup from the managed object store using the default framework instance...
Definition: SecGroup.hpp:124
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupSubject from the managed object store.
Definition: SecGroupSubject.hpp:102
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: SecGroup.hpp:421