47 #ifndef _MIRA_AUTHORITYMANAGER_H_ 48 #define _MIRA_AUTHORITYMANAGER_H_ 81 boost::shared_lock<boost::shared_mutex> mLock;
88 mShared(new Shared(iAuthority, mutex)) {}
98 boost::shared_ptr<Shared> mShared;
109 template<
typename Reflector>
112 r.member(
"Value",
value,
"The property value (if query succeeded)");
113 r.member(
"SerializedException",
exception,
114 "Buffer containing the serialized exception (or empty)");
115 r.member(
"ErrorMessage",
message,
116 "The error message from the exception (or empty)");
139 template<
typename Reflector>
142 r.interface(
"IAuthorityManager");
144 "Returns if an authority with the given global id exists.",
145 "id",
"authority id",
"/MyAuthority");
147 "Returns true if authority with given id is a local one " 148 "(The instance lives in this framework/process).",
149 "id",
"authority id",
"/MyAuthority");
151 "Returns a list of existing authorities.");
170 void start(
const std::string&
id)
const;
175 void stop(
const std::string&
id)
const;
181 bool hasAuthority(
const std::string&
id)
const;
187 bool isRunning(
const std::string&
id)
const;
193 bool isLocal(
const std::string&
id)
const;
199 bool hasUnrecoverableFailure(
const std::string&
id)
const;
217 std::set<std::string> getPublishedChannels(
const std::string&
id)
const;
222 std::set<std::string> getSubscribedChannels(
const std::string&
id)
const;
228 boost::shared_ptr<PropertyNode> getProperties(
const std::string&
id)
const;
234 std::set<std::string> getAuthorities()
const;
244 struct LockableAuthority
248 AbstractAuthority* authority;
249 boost::shared_mutex mutex;
251 typedef boost::shared_ptr<LockableAuthority> LockableAuthorityPtr;
252 typedef std::map<std::string, LockableAuthorityPtr> AuthorityMap;
255 AuthorityMap mAuthorities;
258 mutable boost::mutex mAuthoritiesMutex;
273 LockableAuthorityPtr findAuthority(
const std::string&
id)
const;
Authority class that is used to access the functionality of the framework.
bool hasAuthority(const std::string &id) const
Returns if an authority with the given global id exists.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
void reflect(Reflector &r)
Definition: AuthorityManager.h:110
std::multimap< std::string, Status > StatusMap
Definition: Status.h:295
class MIRA_FRAMEWORK_EXPORT Authority
forward declaration
Definition: RemoteConnection.h:74
This is the descriptive part of an authority.
Definition: AuthorityDescription.h:61
json::Value value
Definition: AuthorityManager.h:119
#define MIRA_FRAMEWORK_EXPORT
Definition: FrameworkExports.h:61
void reflect(Reflector &r)
Reflect method for serialization.
Definition: AuthorityManager.h:140
Buffer< uint8 > exception
Definition: AuthorityManager.h:120
json_spirit::mValue Value
A value is an abstract description of data in JSON (underlying data can either be one of the JSON bas...
Definition: JSON.h:176
Central instance that stores all created Authorities.
Definition: AuthorityManager.h:130
A structure used for returning the complete result of a (remote) property query, including potential ...
Definition: AuthorityManager.h:107
SharedAuthority(AbstractAuthority *iAuthority, boost::shared_mutex &mutex)
There is no need to call this constructor manually.
Definition: AuthorityManager.h:87
AbstractAuthority * authority()
access the wrapped AbstractAuthority pointer
Definition: AuthorityManager.h:94
This is the abstract base class of local and remote authority classes.
Definition: AbstractAuthority.h:76
std::set< std::string > getAuthorities() const
Returns a list of existing authorities.
A wrapper providing locked/shared access to an AbstractAuthority pointer (used by AuthorityManager::g...
Definition: AuthorityManager.h:66
std::string message
Definition: AuthorityManager.h:121
bool isLocal(const std::string &id) const
Returns true if authority with given id is a local one (The instance lives in this framework/process)...