46 using namespace detail;
48 using namespace boost;
53 owner->
provides()->addService( ret );
83 log(
Error) <<
"Could not add Service " << obj->getName() <<
": name already in use." <<
endlog();
89 me = shared_from_this();
90 }
catch ( boost::bad_weak_ptr& bw ) {
115 return shared_from_this();
116 }
catch( boost::bad_weak_ptr& ) {
117 log(
Error) <<
"When using boost < 1.40.0 : You are not allowed to call provides() on a Service that does not yet belong to a TaskContext or another Service (for example in a constructor)." <<
endlog();
118 log(
Error) <<
"Try to avoid using provides() in this case: omit it or use the service directly." <<
endlog();
119 throw std::runtime_error(
"Illegal use of provides()");
127 sp = boost::make_shared<Service>(service_name,
mowner);
134 if (service_name ==
"this")
136 Services::iterator it =
services.find(service_name);
173 if (service_name ==
"this")
187 log(
Error) <<
"Failed to add Operation: '"<< op.
getName() <<
"' is not ready: not bound to a function." <<
endlog();
191 log(
Warning) <<
"While adding Operation: '"<< op.
getName() <<
"': replacing previously added operation." <<
endlog();
207 return boost::shared_ptr<base::DisposableInterface>();
256 it->second->setOwner( new_owner ? new_owner->
engine() : 0);
261 it->second->setOwner( new_owner );
const std::string & getName() const
void setParent(shared_ptr new_parent)
TaskContext * getOwner() const
Service::shared_ptr provides()
bool hasOperation(const std::string &name) const
static Service::shared_ptr Create(const std::string &name, TaskContext *owner=0)
Service::shared_ptr provides()
boost::shared_ptr< base::DisposableInterface > getLocalOperation(std::string name)
Service(const std::string &name, TaskContext *owner=0)
bool setThread(ExecutionThread et, ExecutionEngine *executor)
virtual void removeService(std::string const &service_name)
Services services
the services we implement.
bool hasMember(const std::string &name) const
virtual ProviderNames getProviderNames() const
void removeOperation(const std::string &name)
bool resetOperation(std::string name, base::OperationBase *impl)
boost::shared_ptr< OperationCallerInterface > shared_ptr
boost::shared_ptr< Service > shared_ptr
OperationInterfacePart * getPart(const std::string &name)
Service * getService() const
SimpleOperations simpleoperations
virtual bool addService(shared_ptr obj)
bool hasService(const std::string &service_name)
bool addLocalOperation(base::OperationBase &op)
virtual DisposableInterface::shared_ptr getImplementation()=0
boost::shared_ptr< DisposableInterface > shared_ptr
std::vector< std::string > getOperationNames() const
virtual RTT_API boost::shared_ptr< base::DisposableInterface > getLocalOperation() const
OperationList ownedoperations
std::vector< typename MapT::key_type > keys(const MapT &map)
ExecutionEngine * getOwnerExecutionEngine() const
void setOwner(ExecutionEngine *ee)
OperationInterfacePart * getOperation(std::string name)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
bool setOperationThread(std::string const &name, ExecutionThread et)
const std::string & getName()
void setOwner(TaskContext *new_owner)
internal::OperationCallerC create(std::string name, ExecutionEngine *caller)
void remove(const std::string &name)
const ExecutionEngine * engine() const
static Logger::LogFunction endlog()