modelgbp Generated OpFlex Model  1.7.0
AllowDenyAction.hpp
1 
10 #pragma once
11 #ifndef GI_GBP_ALLOWDENYACTION_HPP
12 #define GI_GBP_ALLOWDENYACTION_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(gbp/RuleFromActionRTgt)
19  */
20 #include "modelgbp/gbp/RuleFromActionRTgt.hpp"
21 
22 namespace modelgbp {
23 namespace gbp {
24 
26  : public opflex::modb::mointernal::MO
27 {
28 public:
29 
33  static const opflex::modb::class_id_t CLASS_ID = 141;
34 
39  bool isAllowSet()
40  {
41  return getObjectInstance().isSet(4620291ul, opflex::modb::PropertyInfo::U64);
42  }
43 
48  boost::optional<const uint8_t> getAllow()
49  {
50  if (isAllowSet())
51  return (const uint8_t)getObjectInstance().getUInt64(4620291ul);
52  return boost::none;
53  }
54 
60  const uint8_t getAllow(const uint8_t defaultValue)
61  {
62  return getAllow().get_value_or(defaultValue);
63  }
64 
73  modelgbp::gbp::AllowDenyAction& setAllow(const uint8_t newValue)
74  {
75  getTLMutator().modify(getClassId(), getURI())->setUInt64(4620291ul, newValue);
76  return *this;
77  }
78 
86  {
87  getTLMutator().modify(getClassId(), getURI())->unset(4620291ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
88  return *this;
89  }
90 
95  bool isNameSet()
96  {
97  return getObjectInstance().isSet(4620289ul, opflex::modb::PropertyInfo::STRING);
98  }
99 
104  boost::optional<const std::string&> getName()
105  {
106  if (isNameSet())
107  return getObjectInstance().getString(4620289ul);
108  return boost::none;
109  }
110 
116  const std::string& getName(const std::string& defaultValue)
117  {
118  return getName().get_value_or(defaultValue);
119  }
120 
129  modelgbp::gbp::AllowDenyAction& setName(const std::string& newValue)
130  {
131  getTLMutator().modify(getClassId(), getURI())->setString(4620289ul, newValue);
132  return *this;
133  }
134 
142  {
143  getTLMutator().modify(getClassId(), getURI())->unset(4620289ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
144  return *this;
145  }
146 
151  bool isOrderSet()
152  {
153  return getObjectInstance().isSet(4620290ul, opflex::modb::PropertyInfo::U64);
154  }
155 
160  boost::optional<uint32_t> getOrder()
161  {
162  if (isOrderSet())
163  return (uint32_t)getObjectInstance().getUInt64(4620290ul);
164  return boost::none;
165  }
166 
172  uint32_t getOrder(uint32_t defaultValue)
173  {
174  return getOrder().get_value_or(defaultValue);
175  }
176 
186  {
187  getTLMutator().modify(getClassId(), getURI())->setUInt64(4620290ul, newValue);
188  return *this;
189  }
190 
198  {
199  getTLMutator().modify(getClassId(), getURI())->unset(4620290ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
200  return *this;
201  }
202 
214  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::AllowDenyAction> > resolve(
215  opflex::ofcore::OFFramework& framework,
216  const opflex::modb::URI& uri)
217  {
218  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::AllowDenyAction>(framework, CLASS_ID, uri);
219  }
220 
232  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::AllowDenyAction> > resolve(
233  const opflex::modb::URI& uri)
234  {
235  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::AllowDenyAction>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
236  }
237 
256  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::AllowDenyAction> > resolve(
257  opflex::ofcore::OFFramework& framework,
258  const std::string& policySpaceName,
259  const std::string& gbpAllowDenyActionName)
260  {
261  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpAllowDenyAction").addElement(gbpAllowDenyActionName).build());
262  }
263 
281  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::AllowDenyAction> > resolve(
282  const std::string& policySpaceName,
283  const std::string& gbpAllowDenyActionName)
284  {
285  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpAllowDenyActionName);
286  }
287 
299  boost::optional<OF_SHARED_PTR<modelgbp::gbp::RuleFromActionRTgt> > resolveGbpRuleFromActionRTgt(
300  const std::string& gbpRuleFromActionRTgtSource)
301  {
302  return modelgbp::gbp::RuleFromActionRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("GbpRuleFromActionRTgt").addElement(gbpRuleFromActionRTgtSource).build());
303  }
304 
317  OF_SHARED_PTR<modelgbp::gbp::RuleFromActionRTgt> addGbpRuleFromActionRTgt(
318  const std::string& gbpRuleFromActionRTgtSource)
319  {
320  OF_SHARED_PTR<modelgbp::gbp::RuleFromActionRTgt> result = addChild<modelgbp::gbp::RuleFromActionRTgt>(
321  CLASS_ID, getURI(), 2152104086ul, 150,
322  opflex::modb::URIBuilder(getURI()).addElement("GbpRuleFromActionRTgt").addElement(gbpRuleFromActionRTgtSource).build()
323  );
324  result->setSource(gbpRuleFromActionRTgtSource);
325  return result;
326  }
327 
342  void resolveGbpRuleFromActionRTgt(/* out */ std::vector<OF_SHARED_PTR<modelgbp::gbp::RuleFromActionRTgt> >& out)
343  {
344  opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::RuleFromActionRTgt>(
345  getFramework(), CLASS_ID, getURI(), 2152104086ul, 150, out);
346  }
347 
356  void remove()
357  {
358  getTLMutator().remove(CLASS_ID, getURI());
359  }
360 
371  static void remove(opflex::ofcore::OFFramework& framework,
372  const opflex::modb::URI& uri)
373  {
374  MO::remove(framework, CLASS_ID, uri);
375  }
376 
387  static void remove(const opflex::modb::URI& uri)
388  {
389  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
390  }
391 
408  static void remove(
409  opflex::ofcore::OFFramework& framework,
410  const std::string& policySpaceName,
411  const std::string& gbpAllowDenyActionName)
412  {
413  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpAllowDenyAction").addElement(gbpAllowDenyActionName).build());
414  }
415 
432  static void remove(
433  const std::string& policySpaceName,
434  const std::string& gbpAllowDenyActionName)
435  {
436  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpAllowDenyActionName);
437  }
438 
450  static void registerListener(
451  opflex::ofcore::OFFramework& framework,
452  opflex::modb::ObjectListener* listener)
453  {
454  opflex::modb::mointernal
455  ::MO::registerListener(framework, listener, CLASS_ID);
456  }
457 
469  static void registerListener(
470  opflex::modb::ObjectListener* listener)
471  {
472  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
473  }
474 
481  static void unregisterListener(
482  opflex::ofcore::OFFramework& framework,
483  opflex::modb::ObjectListener* listener)
484  {
485  opflex::modb::mointernal
486  ::MO::unregisterListener(framework, listener, CLASS_ID);
487  }
488 
495  static void unregisterListener(
496  opflex::modb::ObjectListener* listener)
497  {
498  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
499  }
500 
506  opflex::ofcore::OFFramework& framework,
507  const opflex::modb::URI& uri,
508  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
509  : MO(framework, CLASS_ID, uri, oi) { }
510 }; // class AllowDenyAction
511 
512 } // namespace gbp
513 } // namespace modelgbp
514 #endif // GI_GBP_ALLOWDENYACTION_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of AllowDenyAction from the managed object store using the default framework ins...
Definition: AllowDenyAction.hpp:232
Definition: AllowDenyAction.hpp:25
bool isNameSet()
Check whether name has been set.
Definition: AllowDenyAction.hpp:95
AllowDenyAction(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of AllowDenyAction.
Definition: AllowDenyAction.hpp:505
modelgbp::gbp::AllowDenyAction & unsetOrder()
Unset order in the currently-active mutator.
Definition: AllowDenyAction.hpp:197
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of AllowDenyAction from the managed object store.
Definition: AllowDenyAction.hpp:214
modelgbp::gbp::AllowDenyAction & unsetAllow()
Unset allow in the currently-active mutator.
Definition: AllowDenyAction.hpp:85
modelgbp::gbp::AllowDenyAction & setAllow(const uint8_t newValue)
Set allow to the specified value in the currently-active mutator.
Definition: AllowDenyAction.hpp:73
modelgbp::gbp::AllowDenyAction & unsetName()
Unset name in the currently-active mutator.
Definition: AllowDenyAction.hpp:141
uint32_t getOrder(uint32_t defaultValue)
Get the value of order if set, otherwise the value of default passed in.
Definition: AllowDenyAction.hpp:172
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: AllowDenyAction.hpp:104
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: AllowDenyAction.hpp:495
modelgbp::gbp::AllowDenyAction & setOrder(uint32_t newValue)
Set order to the specified value in the currently-active mutator.
Definition: AllowDenyAction.hpp:185
bool isAllowSet()
Check whether allow has been set.
Definition: AllowDenyAction.hpp:39
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: AllowDenyAction.hpp:481
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: AllowDenyAction.hpp:116
bool isOrderSet()
Check whether order has been set.
Definition: AllowDenyAction.hpp:151
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpAllowDenyActionName)
Retrieve an instance of AllowDenyAction from the managed object store by constructing its URI from th...
Definition: AllowDenyAction.hpp:256
boost::optional< uint32_t > getOrder()
Get the value of order if it has been set.
Definition: AllowDenyAction.hpp:160
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::RuleFromActionRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RuleFromActionRTgt from the managed object store.
Definition: RuleFromActionRTgt.hpp:210
void resolveGbpRuleFromActionRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::RuleFromActionRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::RuleFromActionRTgt.
Definition: AllowDenyAction.hpp:342
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: AllowDenyAction.hpp:450
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolve(const std::string &policySpaceName, const std::string &gbpAllowDenyActionName)
Retrieve an instance of AllowDenyAction from the default managed object store by constructing its URI...
Definition: AllowDenyAction.hpp:281
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for AllowDenyAction.
Definition: AllowDenyAction.hpp:33
OF_SHARED_PTR< modelgbp::gbp::RuleFromActionRTgt > addGbpRuleFromActionRTgt(const std::string &gbpRuleFromActionRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: AllowDenyAction.hpp:317
boost::optional< const uint8_t > getAllow()
Get the value of allow if it has been set.
Definition: AllowDenyAction.hpp:48
modelgbp::gbp::AllowDenyAction & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: AllowDenyAction.hpp:129
const uint8_t getAllow(const uint8_t defaultValue)
Get the value of allow if set, otherwise the value of default passed in.
Definition: AllowDenyAction.hpp:60
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
boost::optional< OF_SHARED_PTR< modelgbp::gbp::RuleFromActionRTgt > > resolveGbpRuleFromActionRTgt(const std::string &gbpRuleFromActionRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: AllowDenyAction.hpp:299
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: AllowDenyAction.hpp:469