VisiBroker for C++ API Reference Guide : Error codes : Native Messaging Interfaces and Classes for C++

Native Messaging Interfaces and Classes for C++
This section describes the interfaces and classes associated with the Native Messaging.
RequestAgent
class NativeMessaging::RequestAgent : public virtual CORBA_Object
The Request Agent interface defines operations of the Native Messaging Request Agent.
Include File
Include the NativeMessaging_c.hh file when you use this class.
IDL definition
module NativeMessaging {
interface RequestAgent {

exception DuplicatedRequestTag {};
exception PollingGroupIsEmpty {};
exception RequestNotExist {};


Request create_request(
in RequestDesc desc) raises (DuplicatedRequestTag);

RequestTagSeq poll(
in string polling_group,
in unsigned long timeout,
in boolean unmask) raises
(PollingGroupIsEmpty);

void destroy_request(
in Request req) raises (RequestNotExist);

};
};
RequestAgent Methods
create_request
virtual ::CORBA::Object_ptr create_request(
const NativeMessaging::RequestDesc& _desc);
This method creates and returns an asynchronous method invocation request object in the Request Agent.
The RequestDesc structure containing information about the target object and async request.
The method throws DuplicatedRequestTag exception.
poll
virtual NativeMessaging::RequestTagSeq* poll(const char* _polling_group, ::CORBA::Ulong _timeout, ::CORBA::Boolean _umask);
The method returns the sequence of request tags whose replies are ready.
This method throws PollingGroupIsEmpty exception.
destroy_request
virtual void destroy_request(::CORBA::Object_ptr _req);
This method destroys an async request.
This method throws RequestNotExist exception.
RequestDesc
struct NativeMessaging::RequestDesc;
A descriptor structure containing all the information needed to service a async request.
Include File
Include the NativeMessaging_c.hh file when you use this struct.
IDL Definition
module NativeMessaging {
typedef Object Request;
typedef sequence<octet> OctetSeq;
typedef OctetSeq RequestTag;
typedef sequence<RequestTag> RequestTagSeq;
typedef OctetSeq Cookie;

struct RequestDesc {
Object target;
string repository_id;
ReplyRecipient reply_recipient;
Cookie the_cookie;
string polling_group;
RequestTag request_tag;
PropertySeq properties;
};
};
RequestDesc Fields
 
Repository id of the target object. If this is an empty string, request agent will try to extract the rep id from the target object reference. If rep id empty here and also null or empty in the target IOR reference, a CORBA::BAD_PARAM exception is thrown. Clients can also use a repository id of *. This acts as a wild card and is_a operation on the request object returns true for any repository id.
A user specified sequence of octets. It will be sent to the reply_recipient when reply_available is called. The information inside the cookie is user defined.
ReplyRecipient
class NativeMessaging::ReplyRecipient : public virtual CORBA_Object
Defines the interface for callback reply recipient.
Include File
Include the NativeMessaging_c.hh file when you use this class.
module NativeMessaging {
interface ReplyRecipient {
void reply_available(
in Request reply_holder,
in string operation,
in Cookie the_Cookie);
};
};
ReplyRecipient methods
reply_available
virtual void reply_available(::CORBA::Object_ptr _reply_holder, const char* _operation, const NativeMessaging::OctetSeq& _the_Cookie);
REPLY_NOT_AVAILABLE
This constant defines the CORBA::NO_RESPONSE exception minor code value thrown by the RequestAgent to the polling client when the reply for a request is not available.
Include File
Include the NativeMessaging_c.hh file when you use this constant.
IDL definition
module NativeMessaging {
const unsigned long REPLY_NOT_AVAILABLE = 100;
};
Property
struct NativeMessaging::Property;
Holds a symbolic property name and its value inside an CORBA::Any.
Include File
Include the NativeMessaging_c.hh file when you use this struct.
IDL definition
module NativeMessaging {
struct Property {
string name;
any value;
};
};
Property Fields
 
The value of the property. The RequestManualTrash has a value of type boolean: If set to true, the request is destroyed manually by calling destroy_request method. If set to false, the request is destroyed automatically once the reply is read (default).
PropertySeq
class NativeMessaging::PropertySeq : private VISResource
A Sequence of Property that is passed inside RequestDesc while creating async Request.
Include File
Include the NativeMessaging_c.hh file when you use this class.
OctetSeq
class NativeMessaging::OctetSeq : private VISResource
This class represents a sequence of octets. Similar to CORBA::OctetSeq but defined here to make the NativeMessaging.idl independent of any other IDL.
Include File
Include the NativeMessaging_c.hh file when you use this class.
RequestTag
typedef OctetSeq RequestTag;
An octet sequence identifying a request inside a polling group.
Include File
Include the NativeMessaging_c.hh file when you use this class.
RequestTagSeq
class NativeMessaging::RequestTagSeq : private VISResource
Instances of this class are returned by the RequestAgent's poll method when group polling is performed. Each element in the sequence is a RequestTag; the octet sequence identifying a request inside the polling group.
Include File
Include the NativeMessaging_c.hh file when you use this class.
Cookie
typedef OctetSeq Cookie
An octet sequence that is passed inside RequestDesc while creating async Request. The contents inside the Cookie are user defined. The Request Agent passes this Cookie to ReplyRecipient's reply_available method when callback occurs.
Include File
Include the NativeMessaging_c.hh file when you use this type.
DuplicatedRequestTag
class DuplicatedRequestTag : public CORBA_UserException
This class defines a UserException that is raised if the async request is created with a polling group name specified and the there is another request in the polling group with the same request tag.
Include File
Include the NativeMessaging_c.hh file when you use this class.
PollingGroupIsEmpty
class PollingGroupIsEmpty : public CORBA_UserException
This class defines a UserException that is raised if poll method is called on the RequestAgent and:
1
2
Include File
Include the NativeMessaging_c.hh file when you use this class.
RequestNotExist
class RequestNotExist : public CORBA_UserException
This class defines a UserException that is raised if the destroy_request method is called on RequestAgent and the specified request could not be found or is already destroyed.
Include File
Include the NativeMessaging_c.hh file when you use this class.