Principal.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Principal.h
00006  *
00007  *  Principal.h,v 1.28 2006/06/19 14:51:11 parsons Exp
00008  *
00009  *  The CORBA::Principal pseudo-object implementation.
00010  *
00011  *  @author  Copyright 1994-1995 by Sun Microsystems Inc.
00012  *  @author  DOC group at Wash U and UCI.
00013  */
00014 //=============================================================================
00015 
00016 
00017 #ifndef TAO_PRINCIPAL_H
00018 #define TAO_PRINCIPAL_H
00019 
00020 #include /**/ "ace/pre.h"
00021 
00022 #include "tao/CORBA_methods.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "tao/OctetSeqC.h"
00029 #include "tao/Pseudo_VarOut_T.h"
00030 
00031 #include "ace/Thread_Mutex.h"
00032 #include "ace/Atomic_Op.h"
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 namespace CORBA
00037 {
00038   class Principal;
00039   typedef Principal *Principal_ptr;
00040 
00041   typedef TAO_Pseudo_Var_T<Principal> Principal_var;
00042   typedef TAO_Pseudo_Out_T<Principal> Principal_out;
00043 
00044   /**
00045    * @class Principal
00046    *
00047    * @brief A "Principal" identifies an authenticated entity in the
00048    * network administration framework.
00049    *
00050    * Identities are used to control acccess (authorization) as well as
00051    * in audit trails (accountability).
00052    *
00053    * @note This CORBA feature has been deprecated by the OMG.  Use the
00054    *       CORBA Security Service instead.
00055    */
00056   class TAO_Export Principal
00057   {
00058   public:
00059     // To applications, the identifier is an opaque ID.
00060 
00061     //  CORBA::SEQUENCE <CORBA::Octet> id;
00062     CORBA::OctetSeq id;
00063 
00064     // @@ add "==", "<", ">" operators
00065 
00066     // The pseudo object operations.
00067     static Principal * _duplicate (Principal *);
00068     static Principal * _nil (void);
00069 
00070     // = Stuff required for memory management.
00071     CORBA::ULong _incr_refcnt (void);
00072     CORBA::ULong _decr_refcnt (void);
00073 
00074     Principal (void);
00075 
00076     // Useful for template programming.
00077     typedef Principal_ptr _ptr_type;
00078     typedef Principal_var _var_type;
00079 
00080   protected:
00081 
00082     /// Destructor
00083     /**
00084      * Protected destructor to enforce proper memory management
00085      * through the reference counting mechanism.
00086      */
00087     ~Principal (void);
00088 
00089   private:
00090 
00091     // = Prevent copying
00092     Principal &operator = (const CORBA::Principal_ptr &);
00093     Principal (const CORBA::Principal_ptr &);
00094 
00095   private:
00096     /// Reference counter.
00097     ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> refcount_;
00098   };
00099 }  // End CORBA namespace
00100 
00101 TAO_Export CORBA::Boolean
00102 operator<< (TAO_OutputCDR &, CORBA::Principal *);
00103 
00104 TAO_Export CORBA::Boolean
00105 operator>> (TAO_InputCDR &, CORBA::Principal *&);
00106 
00107 TAO_END_VERSIONED_NAMESPACE_DECL
00108 
00109 #if defined (__ACE_INLINE__)
00110 # include "tao/Principal.i"
00111 #endif /* __ACE_INLINE__ */
00112 
00113 #include /**/ "ace/post.h"
00114 
00115 #endif /* TAO_PRINCIPAL_H */

Generated on Thu Nov 9 11:54:20 2006 for TAO by doxygen 1.3.6