Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

CORBA::AbstractBase Class Reference

Abstract base class for Interfaces and Valuetypes. More...

#include <AbstractBase.h>

Collaboration diagram for CORBA::AbstractBase:
Collaboration graph
[legend]

List of all members.

Public Types

typedef CORBA::AbstractBase_ptr _ptr_type
typedef CORBA::AbstractBase_var _var_type
typedef CORBA::AbstractBase_out _out_type

Public Member Functions

 AbstractBase (TAO_Stub *p, CORBA::Boolean collocated, TAO_Abstract_ServantBase *servant)
 Constructor.
CORBA::Object_ptr _to_object (void)
 Spec required conversion operations.
CORBA::ValueBase_to_value (void)
virtual CORBA::Boolean _is_a (const char *type_id)
virtual const char * _interface_repository_id (void) const
virtual const char * _tao_obv_repository_id (void) const
 TAO specific operations.
virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR &strm) const
virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR &strm)
virtual CORBA::Boolean _tao_match_formal_type (ptrdiff_t) const
virtual void _add_ref (void)
 Memmory management operations.
virtual void _remove_ref (void)
CORBA::Boolean _is_objref (void) const
TAO_Stub_stubobj (void) const
 Return the stub object.
CORBA::Boolean _is_collocated (void) const
 Acessors.
TAO_Abstract_ServantBase_servant (void) const
CORBA::Boolean _is_local (void) const
CORBA::Object_ptr equivalent_objref (void)
 Return the equivalent object reference.

Static Public Member Functions

static CORBA::AbstractBase_ptr _narrow (CORBA::AbstractBase_ptr obj)
static CORBA::AbstractBase_ptr _duplicate (CORBA::AbstractBase_ptr obj)
static CORBA::AbstractBase_ptr _nil (void)
static void _tao_any_destructor (void *)
 Used in the implementation of CORBA::Any.

Protected Member Functions

 AbstractBase (void)
 AbstractBase (const AbstractBase &)
virtual ~AbstractBase (void)

Protected Attributes

CORBA::Boolean is_objref_

Private Member Functions

AbstractBaseoperator= (const AbstractBase &)
virtual CORBA::ValueBase_tao_to_value (void)

Private Attributes

TAO_Stubconcrete_stubobj_
CORBA::Boolean is_collocated_
TAO_Abstract_ServantBaseservant_
CORBA::Boolean is_local_
CORBA::Object_var equivalent_obj_

Detailed Description

Abstract base class for Interfaces and Valuetypes.

Allows the determination of whether an object has been passed by reference or by value to be deferred until runtime.

Definition at line 56 of file AbstractBase.h.


Member Typedef Documentation

Definition at line 71 of file AbstractBase.h.

Definition at line 69 of file AbstractBase.h.

Definition at line 70 of file AbstractBase.h.


Constructor & Destructor Documentation

CORBA::AbstractBase::AbstractBase ( TAO_Stub p,
CORBA::Boolean  collocated,
TAO_Abstract_ServantBase servant 
)

Constructor.

This constructor is only meant to be called by the corresponding CDR stream extraction operator.

Definition at line 73 of file AbstractBase.cpp.

  : is_objref_ (true)
  , concrete_stubobj_ (protocol_proxy)
  , is_collocated_ (collocated)
  , servant_ (servant)
  , is_local_ (protocol_proxy == 0 ? true : false)
  , equivalent_obj_ (0)
{
  if (this->concrete_stubobj_ != 0)
    {
      TAO_Stub *stub = this->concrete_stubobj_;

      stub->_incr_refcnt ();

      this->equivalent_obj_ =
        stub->orb_core ()->create_object (stub);
    }

}

CORBA::AbstractBase::AbstractBase ( void   )  [protected]

Definition at line 43 of file AbstractBase.cpp.

  : is_objref_ (false)
  , concrete_stubobj_ (0)
  , is_collocated_ (false)
  , servant_ (0)
  , is_local_ (false)
  , equivalent_obj_ (0)
{
}

CORBA::AbstractBase::AbstractBase ( const AbstractBase rhs  )  [protected]

Definition at line 53 of file AbstractBase.cpp.

  : is_objref_ (rhs.is_objref_)
  , concrete_stubobj_ (rhs.concrete_stubobj_)
  , is_collocated_ (rhs.is_collocated_)
  , servant_ (rhs.servant_)
  , is_local_ (rhs.is_local_)
  , equivalent_obj_ (0)
{
  if (rhs.concrete_stubobj_ != 0)
    {
      rhs.concrete_stubobj_->_incr_refcnt ();
    }

  if (!CORBA::is_nil (rhs.equivalent_obj_.in ()))
    {
      this->equivalent_obj_ =
        CORBA::Object::_duplicate (rhs.equivalent_obj_);
    }
}

CORBA::AbstractBase::~AbstractBase ( void   )  [protected, virtual]

Definition at line 95 of file AbstractBase.cpp.

{
  if (this->concrete_stubobj_ != 0)
    {
      this->concrete_stubobj_->_decr_refcnt ();
    }
}


Member Function Documentation

void CORBA::AbstractBase::_add_ref ( void   )  [virtual]

Memmory management operations.

Definition at line 123 of file AbstractBase.cpp.

{
}

CORBA::AbstractBase_ptr CORBA::AbstractBase::_duplicate ( CORBA::AbstractBase_ptr  obj  )  [static]

Definition at line 104 of file AbstractBase.cpp.

{
  if (obj)
    {
      obj->_add_ref ();
    }

  if (!CORBA::is_nil (obj->equivalent_obj_.in ()))
    {
      obj->equivalent_obj_->_add_ref ();
    }

  return obj;
}

const char * CORBA::AbstractBase::_interface_repository_id ( void   )  const [virtual]

Definition at line 186 of file AbstractBase.cpp.

{
  return "IDL:omg.org/CORBA/AbstractBase:1.0";
}

CORBA::Boolean CORBA::AbstractBase::_is_a ( const char *  type_id  )  [virtual]

Definition at line 175 of file AbstractBase.cpp.

{
  if (! CORBA::is_nil (this->equivalent_obj_.in ()))
    {
      return this->equivalent_obj_->_is_a (type_id);
    }

  return (ACE_OS::strcmp (type_id, "IDL:omg.org/CORBA/AbstractBase:1.0") == 0);
}

CORBA::Boolean CORBA::AbstractBase::_is_collocated ( void   )  const

Acessors.

Definition at line 39 of file AbstractBase.inl.

{
  return this->is_collocated_;
}

CORBA::Boolean CORBA::AbstractBase::_is_local ( void   )  const

Definition at line 53 of file AbstractBase.inl.

{
  return this->is_local_;
}

CORBA::Boolean CORBA::AbstractBase::_is_objref ( void   )  const

Definition at line 25 of file AbstractBase.inl.

{
  return this->is_objref_;
}

CORBA::AbstractBase_ptr CORBA::AbstractBase::_narrow ( CORBA::AbstractBase_ptr  obj  )  [static]

Definition at line 17 of file AbstractBase.inl.

CORBA::AbstractBase_ptr CORBA::AbstractBase::_nil ( void   )  [static]

Definition at line 11 of file AbstractBase.inl.

{
  return static_cast <CORBA::AbstractBase_ptr> (0);
}

void CORBA::AbstractBase::_remove_ref ( void   )  [virtual]

Definition at line 128 of file AbstractBase.cpp.

{
}

TAO_Abstract_ServantBase * CORBA::AbstractBase::_servant ( void   )  const

Definition at line 46 of file AbstractBase.inl.

{
  return this->servant_;
}

TAO_Stub * CORBA::AbstractBase::_stubobj ( void   )  const

Return the stub object.

Definition at line 32 of file AbstractBase.inl.

{
  return this->concrete_stubobj_;
}

void CORBA::AbstractBase::_tao_any_destructor ( void *  x  )  [static]

Used in the implementation of CORBA::Any.

Definition at line 133 of file AbstractBase.cpp.

CORBA::Boolean CORBA::AbstractBase::_tao_marshal_v ( TAO_OutputCDR strm  )  const [virtual]

Definition at line 407 of file AbstractBase.cpp.

{
  return false;
}

CORBA::Boolean CORBA::AbstractBase::_tao_match_formal_type ( ptrdiff_t   )  const [virtual]

Definition at line 419 of file AbstractBase.cpp.

{
  return false;
}

const char * CORBA::AbstractBase::_tao_obv_repository_id ( void   )  const [virtual]

TAO specific operations.

Definition at line 192 of file AbstractBase.cpp.

{
  return "IDL:omg.org/CORBA/AbstractBase:1.0";
}

CORBA::ValueBase * CORBA::AbstractBase::_tao_to_value ( void   )  [private, virtual]

Definition at line 442 of file AbstractBase.cpp.

{
  return 0;
}

CORBA::Boolean CORBA::AbstractBase::_tao_unmarshal_v ( TAO_InputCDR strm  )  [virtual]

Definition at line 413 of file AbstractBase.cpp.

{
  return false;
}

CORBA::Object_ptr CORBA::AbstractBase::_to_object ( void   ) 

Spec required conversion operations.

Definition at line 140 of file AbstractBase.cpp.

{
  if (!CORBA::is_nil (this->equivalent_obj_.in ()))
    return CORBA::Object::_duplicate (this->equivalent_obj_.in ());

  if (this->concrete_stubobj_ == 0)
    {
      return CORBA::Object::_nil ();
    }

  TAO_ORB_Core *orb_core = this->concrete_stubobj_->orb_core ();
  this->concrete_stubobj_->_incr_refcnt ();

  return orb_core->create_object (this->concrete_stubobj_);
}

CORBA::ValueBase * CORBA::AbstractBase::_to_value ( void   ) 

Definition at line 157 of file AbstractBase.cpp.

{
  if (this->is_objref_)
    {
      return 0;
    }

  CORBA::ValueBase *retval = this->_tao_to_value ();

  if (retval != 0)
    {
      retval->_add_ref ();
    }

  return retval;
}

CORBA::Object_ptr CORBA::AbstractBase::equivalent_objref ( void   ) 

Return the equivalent object reference.

The object is not refcounted. The caler should not put this in a var or some such thing. The memory is owned by <this> object.

Definition at line 448 of file AbstractBase.cpp.

{
  if (CORBA::is_nil (this->equivalent_obj_.in ()))
    {
      if (this->concrete_stubobj_ != 0)
        {
          TAO_ORB_Core *orb_core =
            this->concrete_stubobj_->orb_core ();

          this->concrete_stubobj_->_incr_refcnt ();

          this->equivalent_obj_ =
            orb_core->create_object (this->concrete_stubobj_);
        }
    }

  return this->equivalent_obj_.in ();
}

AbstractBase& CORBA::AbstractBase::operator= ( const AbstractBase  )  [private]

Member Data Documentation

Definition at line 148 of file AbstractBase.h.

Our equivalent CORBA::Object version

Todo:
We may at some point of time should probably cache a version of CORBA::ValueBase

Definition at line 156 of file AbstractBase.h.

Definition at line 149 of file AbstractBase.h.

Definition at line 151 of file AbstractBase.h.

Definition at line 138 of file AbstractBase.h.

Definition at line 150 of file AbstractBase.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines