A TAO_Profile class to handle foreign profiles. More...
#include <Profile.h>
Public Member Functions | |
TAO_Unknown_Profile (CORBA::ULong tag, TAO_ORB_Core *orb_core) | |
Create the profile. | |
virtual void | parse_string (const char *string) |
virtual char | object_key_delimiter (void) const |
The object key delimiter. | |
virtual char * | to_string (void) |
virtual int | decode (TAO_InputCDR &cdr) |
Initialize this object using the given CDR octet string. | |
virtual int | encode (TAO_OutputCDR &stream) const |
Encode this profile in a stream, i.e. marshal it. | |
virtual int | encode_endpoints (void) |
virtual TAO::ObjectKey * | _key (void) const |
virtual TAO_Endpoint * | endpoint (void) |
virtual CORBA::ULong | endpoint_count (void) const |
Return how many endpoints this profile contains. | |
virtual CORBA::ULong | hash (CORBA::ULong max) |
Return a hash value for this object. | |
virtual int | decode_profile (TAO_InputCDR &cdr) |
Decode the protocol specific profile details. | |
virtual int | decode_endpoints (void) |
Protected Member Functions | |
virtual CORBA::Boolean | do_is_equivalent (const TAO_Profile *other_profile) |
Profile equivalence template method invoked on subclasses. | |
virtual TAO_Service_Callbacks::Profile_Equivalence | is_equivalent_hook (const TAO_Profile *other_profile) |
Allow services to apply their own definition of "equivalence.". | |
Private Member Functions | |
virtual void | create_profile_body (TAO_OutputCDR &encap) const |
Creates an encapsulation of the ProfileBody struct in the cdr. | |
virtual void | parse_string_i (const char *string) |
Protocol specific implementation of parse_string (). | |
Private Attributes | |
TAO_opaque | body_ |
A TAO_Profile class to handle foreign profiles.
The CORBA spec implies that ORBs must be prepared to save and pass around profiles for protocols it does not recognize. It is not mandatory to *use* those profiles but they shouldn't be dropped. This class stores the information required to marshal and demarshal an unknown profile, but simply returns an error if any of the TAO internal methods are invoked.
Definition at line 424 of file Profile.h.
TAO_Unknown_Profile::TAO_Unknown_Profile | ( | CORBA::ULong | tag, | |
TAO_ORB_Core * | orb_core | |||
) |
Create the profile.
Definition at line 773 of file Profile.cpp.
: TAO_Profile (tag, orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)) { }
TAO::ObjectKey * TAO_Unknown_Profile::_key | ( | void | ) | const [virtual] |
Obtain the object key, return 0 if the profile cannot be parsed. The memory is owned by the caller!
Reimplemented from TAO_Profile.
Definition at line 856 of file Profile.cpp.
{
return 0;
}
void TAO_Unknown_Profile::create_profile_body | ( | TAO_OutputCDR & | cdr | ) | const [private, virtual] |
Creates an encapsulation of the ProfileBody struct in the cdr.
Implements TAO_Profile.
Definition at line 888 of file Profile.cpp.
{ // No idea about the profile body! Just return return; }
int TAO_Unknown_Profile::decode | ( | TAO_InputCDR & | cdr | ) | [virtual] |
Initialize this object using the given CDR octet string.
Reimplemented from TAO_Profile.
Definition at line 820 of file Profile.cpp.
{ if (!(cdr >> this->body_)) { return -1; } return 0; }
int TAO_Unknown_Profile::decode_endpoints | ( | void | ) | [virtual] |
Helper for decode(). Decodes endpoints from a tagged component. Decode only if RTCORBA is enabled. Furthermore, we may not find TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT version of TAO or some other ORB. This is not an error, and we must proceed. Return 0 on success and -1 on failure.
Implements TAO_Profile.
Definition at line 837 of file Profile.cpp.
{
return 0;
}
int TAO_Unknown_Profile::decode_profile | ( | TAO_InputCDR & | cdr | ) | [virtual] |
Decode the protocol specific profile details.
Implements TAO_Profile.
Definition at line 831 of file Profile.cpp.
{
return 0;
}
CORBA::Boolean TAO_Unknown_Profile::do_is_equivalent | ( | const TAO_Profile * | other | ) | [protected, virtual] |
Profile equivalence template method invoked on subclasses.
TAO_Profile subclasses must implement this template method so that they can apply their own definition of profile equivalence.
Implements TAO_Profile.
Definition at line 862 of file Profile.cpp.
{ const TAO_Unknown_Profile * op = dynamic_cast <const TAO_Unknown_Profile *> (other_profile); return (CORBA::Boolean) (op == 0 ? 0 : this->body_ == op->body_); }
int TAO_Unknown_Profile::encode | ( | TAO_OutputCDR & | stream | ) | const [virtual] |
Encode this profile in a stream, i.e. marshal it.
Reimplemented from TAO_Profile.
Definition at line 843 of file Profile.cpp.
{ stream.write_ulong (this->tag ()); return (stream << this->body_); }
int TAO_Unknown_Profile::encode_endpoints | ( | void | ) | [virtual] |
Encodes this profile's endpoints into a tagged component. This is done only if RTCORBA is enabled, since currently this is the only case when we have more than one endpoint per profile.
Implements TAO_Profile.
Definition at line 850 of file Profile.cpp.
{
return 0;
}
TAO_Endpoint * TAO_Unknown_Profile::endpoint | ( | void | ) | [virtual] |
Return a pointer to this profile's endpoint. If the profile contains more than one endpoint, i.e., a list, the method returns the head of the list.
Implements TAO_Profile.
Definition at line 783 of file Profile.cpp.
{
return 0;
}
CORBA::ULong TAO_Unknown_Profile::endpoint_count | ( | void | ) | const [virtual] |
Return how many endpoints this profile contains.
Implements TAO_Profile.
Definition at line 789 of file Profile.cpp.
{
return 0;
}
CORBA::ULong TAO_Unknown_Profile::hash | ( | CORBA::ULong | max | ) | [virtual] |
Return a hash value for this object.
Implements TAO_Profile.
Definition at line 880 of file Profile.cpp.
{ return (ACE::hash_pjw (reinterpret_cast <const char*> (this->body_.get_buffer ()), this->body_.length ()) % max); }
TAO_Service_Callbacks::Profile_Equivalence TAO_Unknown_Profile::is_equivalent_hook | ( | const TAO_Profile * | other | ) | [protected, virtual] |
Allow services to apply their own definition of "equivalence.".
This method differs from the do_is_equivalent()
template method in that it has a default implementation that may or not be applicable to all TAO_Profile subclasses.
Reimplemented from TAO_Profile.
Definition at line 871 of file Profile.cpp.
{ // Override the default implementation since we don't need the // additional checks it performs. return TAO_Service_Callbacks::DONT_KNOW; }
char TAO_Unknown_Profile::object_key_delimiter | ( | void | ) | const [virtual] |
The object key delimiter.
Implements TAO_Profile.
Definition at line 807 of file Profile.cpp.
{
return 0;
}
void TAO_Unknown_Profile::parse_string | ( | const char * | string | ) | [virtual] |
Initialize this object using the given input string. Supports URL style of object references
Reimplemented from TAO_Profile.
Definition at line 795 of file Profile.cpp.
{
// @@ THROW something????
}
void TAO_Unknown_Profile::parse_string_i | ( | const char * | string | ) | [private, virtual] |
Protocol specific implementation of parse_string ().
Implements TAO_Profile.
Definition at line 801 of file Profile.cpp.
{
// @@ THROW something????
}
char * TAO_Unknown_Profile::to_string | ( | void | ) | [virtual] |
Return a string representation for this profile. Client must deallocate memory. Only one endpoint is included into the string.
Implements TAO_Profile.
Definition at line 813 of file Profile.cpp.
{ // @@ THROW something? return 0; }
TAO_opaque TAO_Unknown_Profile::body_ [private] |