11 #ifndef GI_INV_REMOTEIP_HPP
12 #define GI_INV_REMOTEIP_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
22 :
public opflex::modb::mointernal::MO
29 static const opflex::modb::class_id_t
CLASS_ID = 127;
37 return getObjectInstance().isSet(4161537ul, opflex::modb::PropertyInfo::STRING);
44 boost::optional<const std::string&>
getIp()
47 return getObjectInstance().getString(4161537ul);
56 const std::string&
getIp(
const std::string& defaultValue)
58 return getIp().get_value_or(defaultValue);
71 getTLMutator().modify(getClassId(), getURI())->setString(4161537ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(4161537ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
98 static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> >
resolve(
99 opflex::ofcore::OFFramework& framework,
100 const opflex::modb::URI& uri)
102 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteIp>(framework,
CLASS_ID, uri);
116 static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> >
resolve(
117 const opflex::modb::URI& uri)
119 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteIp>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
140 static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> >
resolve(
141 opflex::ofcore::OFFramework& framework,
142 const std::string& invRemoteInventoryEpUuid,
143 const std::string& invRemoteIpIp)
145 return resolve(framework,opflex::modb::URIBuilder().addElement(
"InvUniverse").addElement(
"InvRemoteEndpointInventory").addElement(
"InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).addElement(
"InvRemoteIp").addElement(invRemoteIpIp).build());
165 static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> >
resolve(
166 const std::string& invRemoteInventoryEpUuid,
167 const std::string& invRemoteIpIp)
169 return resolve(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid,invRemoteIpIp);
182 getTLMutator().remove(
CLASS_ID, getURI());
195 static void remove(opflex::ofcore::OFFramework& framework,
196 const opflex::modb::URI& uri)
198 MO::remove(framework,
CLASS_ID, uri);
211 static void remove(
const opflex::modb::URI& uri)
213 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
233 opflex::ofcore::OFFramework& framework,
234 const std::string& invRemoteInventoryEpUuid,
235 const std::string& invRemoteIpIp)
237 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"InvUniverse").addElement(
"InvRemoteEndpointInventory").addElement(
"InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).addElement(
"InvRemoteIp").addElement(invRemoteIpIp).build());
257 const std::string& invRemoteInventoryEpUuid,
258 const std::string& invRemoteIpIp)
260 remove(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid,invRemoteIpIp);
275 opflex::ofcore::OFFramework& framework,
276 opflex::modb::ObjectListener* listener)
278 opflex::modb::mointernal
279 ::MO::registerListener(framework, listener,
CLASS_ID);
294 opflex::modb::ObjectListener* listener)
306 opflex::ofcore::OFFramework& framework,
307 opflex::modb::ObjectListener* listener)
309 opflex::modb::mointernal
310 ::MO::unregisterListener(framework, listener,
CLASS_ID);
320 opflex::modb::ObjectListener* listener)
330 opflex::ofcore::OFFramework& framework,
331 const opflex::modb::URI& uri,
332 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
333 : MO(framework,
CLASS_ID, uri, oi) { }
338 #endif // GI_INV_REMOTEIP_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invRemoteInventoryEpUuid, const std::string &invRemoteIpIp)
Retrieve an instance of RemoteIp from the managed object store by constructing its URI from the path ...
Definition: RemoteIp.hpp:140
modelgbp::inv::RemoteIp & setIp(const std::string &newValue)
Set ip to the specified value in the currently-active mutator.
Definition: RemoteIp.hpp:69
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: RemoteIp.hpp:319
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RemoteIp from the managed object store.
Definition: RemoteIp.hpp:98
const std::string & getIp(const std::string &defaultValue)
Get the value of ip if set, otherwise the value of default passed in.
Definition: RemoteIp.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(const std::string &invRemoteInventoryEpUuid, const std::string &invRemoteIpIp)
Retrieve an instance of RemoteIp from the default managed object store by constructing its URI from t...
Definition: RemoteIp.hpp:165
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for RemoteIp.
Definition: RemoteIp.hpp:29
modelgbp::inv::RemoteIp & unsetIp()
Unset ip in the currently-active mutator.
Definition: RemoteIp.hpp:81
bool isIpSet()
Check whether ip has been set.
Definition: RemoteIp.hpp:35
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: RemoteIp.hpp:293
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of RemoteIp from the managed object store using the default framework instance...
Definition: RemoteIp.hpp:116
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: RemoteIp.hpp:44
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: RemoteIp.hpp:274
RemoteIp(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of RemoteIp.
Definition: RemoteIp.hpp:329
Definition: RemoteIp.hpp:21
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: RemoteIp.hpp:305