47 #ifndef _MIRA_SERVICEPROPERTY_H_ 48 #define _MIRA_SERVICEPROPERTY_H_ 85 mService(other.mService), mInterface(other.mInterface) {}
89 mInterface(interface) {}
91 template <
typename Reflector>
93 r.member(
"Service", mService,
"The concrete service that is used",
"");
94 r.member(
"Interface", mInterface,
"The interface that is required");
98 r.
member(
"Service", mService,
"The concrete service that is used",
"");
100 std::string interface;
101 r.
member(
"Interface", interface,
"The interface that is required",
104 if (interface.empty()) {
105 if (mService.empty()) {
109 if (!mService.empty()) {
110 MIRA_LOG(
WARNING) <<
"Expected Service and (optional) Interface nodes for " 111 "ServiceProperty '" << *r.
getNode() <<
"', " 112 "found string '" << mService <<
113 "' (assuming this for service name). " 114 "Please update your config xml (" <<
119 mInterface = interface;
123 if (mInterface.empty())
125 "ServiceProperty: Node 'Interface' is missing or empty");
129 return mInterface == other.mInterface && mService == other.mService;
137 mService = other.mService;
138 mInterface = other.mInterface;
154 mInterface = interface;
162 operator std::string()
const {
return mService; }
165 return mService.empty();
169 return mService.empty();
176 return MIRA_FW.getRPCManager().existsService(mService);
181 std::string mService;
182 std::string mInterface;
bool empty() const
Definition: ServiceProperty.h:168
This object can use object tracking internally, but the object tracking system's state remains unchan...
Definition: ReflectControlFlags.h:82
void reflect(XMLDeserializer &r)
Definition: ServiceProperty.h:97
ServiceProperty & operator=(const std::string &s)
Definition: ServiceProperty.h:142
std::string uri() const
Return the uri of the node.
Use this class instead of a string property whenever your module has a service as property...
Definition: ServiceProperty.h:78
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
void member(const char *name, T &member, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Definition: RecursiveMemberReflector.h:883
#define MIRA_LOG(level)
Use this macro to log data.
Definition: LoggingCore.h:529
#define MIRA_FW
Macro for accessing the framework instance.
Definition: Framework.h:74
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:78
Marker for indicating parameters that should be ignored if they are missing in the config file...
bool isEmpty() const
Definition: ServiceProperty.h:164
void setInterface(const std::string &interface)
Sets the interface a service must implement.
Definition: ServiceProperty.h:153
Marker for indicating parameters that should be ignored if they are missing in the config file...
Definition: IgnoreMissing.h:73
Contains the base interface of all Reflectors, Serializers, etc.
bool operator==(const ServiceProperty &other) const
Definition: ServiceProperty.h:128
uint32 line() const
Gets the underlying line number of the loaded document for this node.
ServiceProperty(const std::string &interface)
Constructor where the interface is specified that the service must implement.
Definition: ServiceProperty.h:88
const std::string & getInterface() const
Return the interface a service must implement.
Definition: ServiceProperty.h:158
Definition: LoggingCore.h:76
void atomic(T &member)
Definition: XMLSerializer.h:452
void reflect(Reflector &r)
Definition: ServiceProperty.h:92
XMLSerializer and XMLDeserializer.
bool isValid() const
Definition: ServiceProperty.h:172
ServiceProperty & operator=(const ServiceProperty &other)
Definition: ServiceProperty.h:136
bool operator!=(const ServiceProperty &other) const
Definition: ServiceProperty.h:132
The framework that holds all manager classes and provides startup and shutdown of all framework relat...
ServiceProperty()
Definition: ServiceProperty.h:82
const std::string & getService() const
Return the service that is associated with this property.
Definition: ServiceProperty.h:148
XMLDom::const_iterator getNode()
Definition: XMLSerializer.h:602
Deserializer for serializing objects from XML format.
Definition: XMLSerializer.h:314
ServiceProperty(const ServiceProperty &other)
Definition: ServiceProperty.h:84