75 RTC_ERROR((
"invalid connection_limit value: %s",
91 const char* type_name,
92 PortableServer::RefCountServantBase&
provider)
94 RTC_TRACE((
"registerProvider(instance=%s, type_name=%s)",
95 instance_name, type_name));
104 RTC_ERROR((
"appending provider interface failed"));
110 RTC_ERROR((
"appending provider interface failed"));
126 const char* type_name,
156 CorbaProviderList::iterator it(
m_providers.begin());
173 CorbaProviderList::iterator it(
m_providers.begin());
203 CorbaProviderList::iterator it(
m_providers.begin());
209 std::string newdesc((
const char*)
m_profile.name);
211 newdesc +=
".provided." + it->descriptor();
220 olddesc +=
"port." + it->descriptor();
229 CORBA::ULong len1(connector_profile.properties.length());
230 CORBA::ULong len2(properties.length());
231 CORBA::ULong len(len1 + len2);
232 connector_profile.properties.length(len);
234 for (CORBA::ULong i = 0; i < len2; ++i)
236 connector_profile.properties[len1 + i] = properties[i];
239 #else // ORB_IS_RTORB 260 const NVList&
nv(connector_profile.properties);
267 const char* strictness;
268 nv[
index].value >>= strictness;
269 if (std::string(
"best_effort") == strictness) { strict =
false; }
270 else if (std::string(
"strict") == strictness) { strict =
true; }
271 RTC_DEBUG((
"Connetion strictness is: %s",
272 strict ?
"strict" :
"best_effort"))
275 for (CorbaConsumerList::iterator it(
m_consumers.begin());
294 RTC_ERROR((
"subscribeInterfaces() failed."));
299 RTC_TRACE((
"subscribeInterfaces() successfully finished."));
316 const NVList&
nv(connector_profile.properties);
319 for (CorbaConsumerList::iterator it(
m_consumers.begin());
325 RTC_DEBUG((
"Correspoinding consumer found."));
331 RTC_DEBUG((
"Correspoinding consumer found."));
349 std::string newdesc((
const char*)
m_profile.name);
355 if (cons_index < 0) {
return false; }
358 if (!(nv[cons_index].value >>= provider))
360 RTC_WARN((
"Cannot extract Provider interface descriptor"));
366 if (prov_index < 0) {
return false; }
369 if (!(nv[prov_index].value >>= ior))
371 RTC_WARN((
"Cannot extract Provider IOR string"));
375 RTC_DEBUG((
"interface matched with new descriptor: %s", newdesc.c_str()));
390 std::string olddesc(
"port."); olddesc += cons.
descriptor();
394 if (index < 0) {
return false; }
397 if (!(nv[index].value >>= ior))
399 RTC_WARN((
"Cannot extract Provider IOR string"));
403 RTC_INFO((
"interface matched with old descriptor: %s", olddesc.c_str()));
417 if (std::string(
"null") == ior) {
return true; }
418 if (std::string(
"nil") == ior) {
return true; }
420 if (std::string(
"IOR:").compare(0, 4, ior.c_str(), 4) != 0)
451 RTC_WARN((
"IORs between Consumer and Connector are different."));
SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
#define RTC_ERROR(fmt)
Error log output macro.
virtual ReturnCode_t publishInterfaces(ConnectorProfile &connector_profile)
Publish information about interfaces.
coil::Properties m_properties
Properties.
std::string m_ownerInstanceName
Instance name.
CorbaPort(const char *name)
Constructor.
bool stringTo(To &val, const char *str)
Convert the given std::string to object.
RT component logger class.
std::vector< std::pair< std::string, std::string > > NVList
void init(coil::Properties &prop)
Initializing properties.
CorbaProviderList m_providers
#define RTC_WARN(fmt)
Warning log output macro.
virtual ~CorbaPort(void)
Virtual destructor.
RTComponent manager class.
#define RTC_DEBUG_STR(str)
bool setObject(const char *ior)
#define RTC_PARANOID(fmt)
Paranoid level log output macro.
const CORBA::Long find_index(const SDOPackage::NVList &nv, const char *name)
Return the index of element specified by name from NVList.
The structure to be stored Consumer information.
#define RTC_DEBUG(fmt)
Debug level log output macro.
std::string toString(const SDOPackage::NVList &nv, const char *name)
Get NVList of specifid name as string.
NameValue and NVList utility functions.
CORBA sequence utility template functions.
The structure to be stored Provider information.
const std::string & getIor()
virtual void unsubscribeInterfaces(const ConnectorProfile &connector_profile)
Unsubscribe interfaces.
virtual void deactivateInterfaces()
Deactivate all Port interfaces.
prop
Organization::get_organization_property ();.
bool setObject(const std::string &ior, CorbaConsumerHolder &cons)
Setting IOR to Consumer.
PortProfile m_profile
PortProfile of the Port.
virtual ReturnCode_t subscribeInterfaces(const ConnectorProfile &connector_profile)
Subscribe to interface.
Class represents a set of properties.
bool appendInterface(const char *name, const char *type_name, PortInterfacePolarity pol)
Append an interface to the PortInterfaceProfile.
virtual bool findProvider(const NVList &nv, CorbaConsumerHolder &cons, std::string &iorstr)
Find out a provider corresponding to the consumer from NVList.
#define RTC_INFO(fmt)
Information level log output macro.
void push_back_list(CorbaSequence &seq1, const CorbaSequence &seq2)
Merge the elements of the CORBA sequence.
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
CorbaConsumerList m_consumers
virtual bool findProviderOld(const NVList &nv, CorbaConsumerHolder &cons, std::string &iorstr)
Find out a provider corresponding to the consumer from NVList.
bool releaseObject(const std::string &ior, CorbaConsumerHolder &cons)
Releasing Consumer Object.
void addProperty(const char *key, ValueType value)
Add NameValue data to PortProfile's properties.
bool registerConsumer(const char *instance_name, const char *type_name, CorbaConsumerBase &consumer)
Register the consumer.
virtual ReturnCode_t _publishInterfaces(void)
Publish interface information.
virtual void activateInterfaces()
Activate all Port interfaces.
virtual void setConnectionLimit(int limit_value)
Set the maximum number of connections.
const std::string & getProperty(const std::string &key) const
Search for the property with the specified key in this property.
bool registerProvider(const char *instance_name, const char *type_name, PortableServer::RefCountServantBase &provider)
Register the provider.