TAO  2.2.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
TAO_MProfile Class Reference

This class implements the basic interface for supporting multiple profiles. More...

#include <MProfile.h>

Collaboration diagram for TAO_MProfile:
Collaboration graph

Public Member Functions

 TAO_MProfile (CORBA::ULong sz=0)
 
 TAO_MProfile (const TAO_MProfile &mprofiles)
 
TAO_MProfileoperator= (const TAO_MProfile &mprofiles)
 Assigment operator. More...
 
 ~TAO_MProfile (void)
 
int set (CORBA::ULong sz)
 
int set (const TAO_MProfile &mprofile)
 
int grow (CORBA::ULong sz)
 
TAO_Profileget_cnext (void)
 Treat as a circular list. More...
 
TAO_Profileget_next (void)
 Get next profile in list, return 0 at end of list. More...
 
TAO_Profileget_cprev (void)
 Assume a circular list of profiles. More...
 
TAO_Profileget_prev (void)
 Get previous profile, stop at beginning of list and return 0. More...
 
TAO_Profileget_current_profile (void)
 
TAO_Profileget_profile (TAO_PHandle handle)
 Return a pointer to the profile referenced by handle void. More...
 
TAO_PHandle get_current_handle (void)
 Returns the index for the current profile. More...
 
TAO_PHandle get_current_handle (void) const
 Returns the index for the current profile. More...
 
CORBA::ULong profile_count (void) const
 Returns the number of profiles stored in the list (last_+1). More...
 
CORBA::ULong size (void) const
 
const TAO_Profileget_profile (CORBA::ULong slot) const
 
void rewind (void)
 Sets the current slot back to 0. More...
 
int add_profile (TAO_Profile *pfile)
 
int give_profile (TAO_Profile *pfile, int share=0)
 
int add_profiles (TAO_MProfile *pfiles)
 
int remove_profile (const TAO_Profile *pfile)
 remove from this MProfile any profiles which also appear in pfiles. More...
 
int remove_profiles (const TAO_MProfile *pfiles)
 remove from this MProfile any profiles which also appear in pfiles. More...
 
void forward_from (TAO_MProfile *mprofiles)
 
TAO_MProfileforward_from (void)
 Returns a pointer to the profile which was forwarded. More...
 
CORBA::Boolean is_equivalent (const TAO_MProfile *rhs)
 
CORBA::ULong hash (CORBA::ULong max)
 
void policy_list (CORBA::PolicyList *policy_list)
 
CORBA::PolicyListpolicy_list (void)
 

Protected Member Functions

void create_policy_list (void)
 
void init_policy_list (void)
 Initialize the policy list, demarsharling the policy. More...
 
TAO_Profile ** pfiles (void) const
 

Protected Attributes

CORBA::PolicyListpolicy_list_
 
CORBA::Boolean is_policy_list_initialized_
 
TAO_SYNCH_RECURSIVE_MUTEX mutex_
 

Private Member Functions

void cleanup (void)
 Helper method to implement the destructor. More...
 
int give_shared_profile (TAO_Profile *pfile)
 

Private Attributes

TAO_MProfileforward_from_
 
TAO_Profile ** pfiles_
 Actual list of profiles. More...
 
TAO_PHandle current_
 Points to the next profile to be used. 0 ... size_. More...
 
TAO_PHandle size_
 Max size of array. More...
 
TAO_PHandle last_
 Index plus 1 of last valid entry! May be < size_. More...
 

Friends

class TAO_Profile
 Stores the policy list for the profile of this MProfile. More...
 

Detailed Description

This class implements the basic interface for supporting multiple profiles.

Multiple profiles can be treated either as a circular queue or a linear array of profiles. It is assumed that locking will only be required when a profile list is associated with a TAO_Stub. Thus when the TAO_Stub accepts ownership of an MProfile it also assumes responsibility for controling access (i.e. locking).

Constructor & Destructor Documentation

TAO_MProfile::TAO_MProfile ( CORBA::ULong  sz = 0)
TAO_MProfile::TAO_MProfile ( const TAO_MProfile mprofiles)

**NOTE: IF mprofiles->last_ > 0, THEN this->size_ will be set to mprofiles->last_. Otherwise this->size_ - mprofiles->size_. Furthermore, current_ is set back to 0! i.e. rewound. The reference count on any profiles in mprofiles is increment when their references (i.e. pointers) are copied.

TAO_MProfile::~TAO_MProfile ( void  )

Destructor: decrements reference count on all references profiles!

Member Function Documentation

int TAO_MProfile::add_profile ( TAO_Profile pfile)

Return the index of this entry or -1 if it can not be added. reference count on profile in incremented!

int TAO_MProfile::add_profiles ( TAO_MProfile pfiles)

append the profiles in pfiles to this object. The count will be incremented on the individual profile objects.

void TAO_MProfile::cleanup ( void  )
private

Helper method to implement the destructor.

void TAO_MProfile::create_policy_list ( void  )
protected

This method handle the dynamic allocation of the data member <policy_list_>.

void TAO_MProfile::forward_from ( TAO_MProfile mprofiles)

Set a pointer to the MProfile whose 'current' TAO_Profile was forwarded This object is the set of forwarding profiles.

TAO_MProfile * TAO_MProfile::forward_from ( void  )

Returns a pointer to the profile which was forwarded.

TAO_Profile * TAO_MProfile::get_cnext ( void  )

Treat as a circular list.

Cyclic get next. It will simply cycle through the complete list.

TAO_Profile * TAO_MProfile::get_cprev ( void  )

Assume a circular list of profiles.

TAO_PHandle TAO_MProfile::get_current_handle ( void  )

Returns the index for the current profile.

TAO_PHandle TAO_MProfile::get_current_handle ( void  ) const

Returns the index for the current profile.

TAO_Profile * TAO_MProfile::get_current_profile ( void  )

Return a pointer to the current profile, will not increment reference pointer.

TAO_Profile * TAO_MProfile::get_next ( void  )

Get next profile in list, return 0 at end of list.

This will return the next element until either null is found or the end of list. It then continues to return NULL until rewind.

TAO_Profile * TAO_MProfile::get_prev ( void  )

Get previous profile, stop at beginning of list and return 0.

TAO_Profile * TAO_MProfile::get_profile ( TAO_PHandle  handle)

Return a pointer to the profile referenced by handle void.

const TAO_Profile * TAO_MProfile::get_profile ( CORBA::ULong  slot) const

Return the profile at position <slot>. If <slot> is out of range it returns 0.

int TAO_MProfile::give_profile ( TAO_Profile pfile,
int  share = 0 
)

Return the index of this entry or -1 if it can not be added. this object assumes ownership of this profile!!

int TAO_MProfile::give_shared_profile ( TAO_Profile pfile)
private

A helper to give_profile to be used when share is true. This method is used primarily to help the corbaloc parser create a single profile with multiple endpoints rather than constructing multiple profiles with 1 endpoint per.

int TAO_MProfile::grow ( CORBA::ULong  sz)

increase the number of profiles this object can hold. NOT THREAD SAFE

CORBA::ULong TAO_MProfile::hash ( CORBA::ULong  max)

use all registered profiles. The hash() method is called on each profile and the results are averaged together. NON-THREAD SAFE.

void TAO_MProfile::init_policy_list ( void  )
protected

Initialize the policy list, demarsharling the policy.

CORBA::Boolean TAO_MProfile::is_equivalent ( const TAO_MProfile rhs)

Returns true of there is at least one profile in first which is_equivalent with at least one profile in second. NON-THREAD SAFE, relies on some other entity to guarentee the profiles will not change during the call.

TAO_MProfile & TAO_MProfile::operator= ( const TAO_MProfile mprofiles)

Assigment operator.

TAO_Profile ** TAO_MProfile::pfiles ( void  ) const
protected

Return the complete list of profiles, this object retains ownership!

void TAO_MProfile::policy_list ( CORBA::PolicyList policy_list)

Sets the policies list associated with the profiles owned by the TAO_MProfile.

CORBA::PolicyList * TAO_MProfile::policy_list ( void  )

Gets the policies list associated with the profiles owned by the TAO_MProfile.

CORBA::ULong TAO_MProfile::profile_count ( void  ) const

Returns the number of profiles stored in the list (last_+1).

int TAO_MProfile::remove_profile ( const TAO_Profile pfile)

remove from this MProfile any profiles which also appear in pfiles.

int TAO_MProfile::remove_profiles ( const TAO_MProfile pfiles)

remove from this MProfile any profiles which also appear in pfiles.

void TAO_MProfile::rewind ( void  )

Sets the current slot back to 0.

int TAO_MProfile::set ( CORBA::ULong  sz)

Inits MProfile to hold sz TAO_Profiles. NOT THREAD SAFE

int TAO_MProfile::set ( const TAO_MProfile mprofile)

Inits this to the values of mprofile. NOTE: We use mprofile->last_ instead of mprofile->size_ to set this->size_. This is so we can use set () to trim a profile list!! NOT THREAD SAFE

CORBA::ULong TAO_MProfile::size ( void  ) const

return the maximum number of profiles that can be stored in this container, (size_+1)

Friends And Related Function Documentation

friend class TAO_Profile
friend

Stores the policy list for the profile of this MProfile.

Member Data Documentation

TAO_PHandle TAO_MProfile::current_
private

Points to the next profile to be used. 0 ... size_.

TAO_MProfile* TAO_MProfile::forward_from_
private

Used for chaning references when the current profile is forwarded. Note, this will only be valid for an MProfile which contains a list of forward_profiles for some initial or base profile. This is a backward reference to the profile list which received the relocate message. The actual profile what was forwarded will be forward_from_->get_current_profile ()

CORBA::Boolean TAO_MProfile::is_policy_list_initialized_
protected
TAO_PHandle TAO_MProfile::last_
private

Index plus 1 of last valid entry! May be < size_.

TAO_SYNCH_RECURSIVE_MUTEX TAO_MProfile::mutex_
protected

Mutex used to make sure that only one policy list is created.

TAO_Profile** TAO_MProfile::pfiles_
private

Actual list of profiles.

CORBA::PolicyList* TAO_MProfile::policy_list_
protected
TAO_PHandle TAO_MProfile::size_
private

Max size of array.


The documentation for this class was generated from the following files: