Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Unknown_Profile Class Reference

A TAO_Profile class to handle foreign profiles. More...

#include <Profile.h>

Inheritance diagram for TAO_Unknown_Profile:

Inheritance graph
[legend]
Collaboration diagram for TAO_Unknown_Profile:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Unknown_Profile (CORBA::ULong tag, TAO_ORB_Core *orb_core)
 Create the profile. More...

virtual void parse_string (const char *string ACE_ENV_ARG_DECL)
 Initialize this object using the given input string. Supports URL style of object references. More...

virtual char object_key_delimiter (void) const
 The object key delimiter. More...

virtual char * to_string (ACE_ENV_SINGLE_ARG_DECL)
 Return a string representation for this profile. client must deallocate memory. More...

virtual int decode (TAO_InputCDR &cdr)
 Initialize this object using the given CDR octet string. More...

virtual int encode (TAO_OutputCDR &stream) const
 Encode this profile in a stream, i.e. marshal it. More...

virtual int encode_endpoints (void)
virtual const TAO_ObjectKeyobject_key (void) const
 deprecated. return a reference to the Object Key. More...

virtual TAO_ObjectKey_key (void) const
 Obtain the object key, return 0 if the profile cannot be parsed. The memory is owned by the caller! More...

virtual TAO_Endpointendpoint (void)
virtual CORBA::ULong endpoint_count (void)
 Return how many endpoints this profile contains. More...

virtual CORBA::Boolean is_equivalent (const TAO_Profile *other_profile)
virtual CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL)
 Return a hash value for this object. More...

virtual IOP::TaggedProfilecreate_tagged_profile (void)

Private Attributes

TAO_opaque body_
IOP::TaggedProfile tagged_profile_

Detailed Description

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 279 of file Profile.h.


Constructor & Destructor Documentation

TAO_Unknown_Profile::TAO_Unknown_Profile CORBA::ULong    tag,
TAO_ORB_Core   orb_core
 

Create the profile.

Definition at line 352 of file Profile.cpp.

References TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.

00354   : TAO_Profile (tag,
00355                  orb_core,
00356                  TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
00357     tagged_profile_ ()
00358 {
00359 }


Member Function Documentation

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!

Implements TAO_Profile.

Definition at line 423 of file Profile.cpp.

00424 {
00425   return 0;
00426 }

IOP::TaggedProfile & TAO_Unknown_Profile::create_tagged_profile void    [virtual]
 

This method is used to get the IOP::TaggedProfile. The profile information that is received from the server side would have already been decoded. So this method will just make a IOP::TaggedProfile struct from the existing information and return the reference to that. This method is necessary for GIOP 1.2.

Implements TAO_Profile.

Definition at line 450 of file Profile.cpp.

References TAO_Profile::tag, IOP::TaggedProfile::tag, and tagged_profile_.

00451 {
00452   this->tagged_profile_.tag = this->tag ();
00453 
00454   // I dont know about the rest, so we return our copy
00455   return this->tagged_profile_;
00456 
00457 }

int TAO_Unknown_Profile::decode TAO_InputCDR   cdr [virtual]
 

Initialize this object using the given CDR octet string.

Implements TAO_Profile.

Definition at line 394 of file Profile.cpp.

References body_.

00395 {
00396   if ((cdr >> this->body_) == 0)
00397     return -1;
00398   return 0;
00399 }

int TAO_Unknown_Profile::encode TAO_OutputCDR   stream const [virtual]
 

Encode this profile in a stream, i.e. marshal it.

Implements TAO_Profile.

Definition at line 402 of file Profile.cpp.

References body_, and ACE_OutputCDR::write_ulong.

00403 {
00404   stream.write_ulong (this->tag ());
00405   return (stream << this->body_);
00406 }

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 409 of file Profile.cpp.

00410 {
00411   return 0;
00412 }

TAO_Endpoint * TAO_Unknown_Profile::endpoint void    [virtual]
 

Return 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 362 of file Profile.cpp.

00363 {
00364   return 0;
00365 }

CORBA::ULong TAO_Unknown_Profile::endpoint_count void    [virtual]
 

Return how many endpoints this profile contains.

Implements TAO_Profile.

Definition at line 368 of file Profile.cpp.

00369 {
00370   return 0;
00371 }

CORBA::ULong TAO_Unknown_Profile::hash CORBA::ULong max    ACE_ENV_ARG_DECL [virtual]
 

Return a hash value for this object.

Implements TAO_Profile.

Definition at line 441 of file Profile.cpp.

References ACE_ENV_ARG_DECL_NOT_USED, body_, ACE::hash_pjw, and TAO_Unbounded_Base_Sequence::length.

00443 {
00444   return (ACE::hash_pjw (ACE_reinterpret_cast (const char*,
00445                                                this->body_.get_buffer ()),
00446                          this->body_.length ()) % max);
00447 }

CORBA::Boolean TAO_Unknown_Profile::is_equivalent const TAO_Profile   other_profile [virtual]
 

Return true if this profile is equivalent to other_profile. Two profiles are equivalent iff their tag, object_key, version and all endpoints are the same.

Implements TAO_Profile.

Definition at line 429 of file Profile.cpp.

References body_, and TAO_Profile::tag.

00430 {
00431   if (other_profile->tag () != this->tag ())
00432     return 0;
00433 
00434   const TAO_Unknown_Profile *op =
00435     ACE_dynamic_cast (const TAO_Unknown_Profile*, other_profile);
00436 
00437   return (CORBA::Boolean) (this->body_ == op->body_);
00438 }

const TAO_ObjectKey & TAO_Unknown_Profile::object_key void    const [virtual]
 

deprecated. return a reference to the Object Key.

@

Implements TAO_Profile.

Definition at line 415 of file Profile.cpp.

00416 {
00417   // @@ TODO this is wrong, but the function is deprecated anyway....
00418   static TAO_ObjectKey empty_key;
00419   return empty_key;
00420 }

char TAO_Unknown_Profile::object_key_delimiter void    const [virtual]
 

The object key delimiter.

Implements TAO_Profile.

Definition at line 381 of file Profile.cpp.

00382 {
00383   return 0;
00384 }

virtual void TAO_Unknown_Profile::parse_string const char *string    ACE_ENV_ARG_DECL [virtual]
 

Initialize this object using the given input string. Supports URL style of object references.

Implements TAO_Profile.

char * TAO_Unknown_Profile::to_string ACE_ENV_SINGLE_ARG_DECL    [virtual]
 

Return a string representation for this profile. client must deallocate memory.

Implements TAO_Profile.

Definition at line 387 of file Profile.cpp.

References ACE_ENV_SINGLE_ARG_DECL_NOT_USED.

00388 {
00389   // @@ THROW something?
00390   return 0;
00391 }


Member Data Documentation

TAO_opaque TAO_Unknown_Profile::body_ [private]
 

Definition at line 304 of file Profile.h.

Referenced by decode, encode, hash, and is_equivalent.

IOP::TaggedProfile TAO_Unknown_Profile::tagged_profile_ [private]
 

Definition at line 305 of file Profile.h.

Referenced by create_tagged_profile.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:46:22 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002