Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Principal.h
blob673f8ebf8a8ed430c87078f72f67a6ecbdf0ac09
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Principal.h
7 * The CORBA::Principal pseudo-object implementation.
9 * @author Copyright 1994-1995 by Sun Microsystems Inc.
10 * @author DOC group at Wash U and UCI.
12 //=============================================================================
14 #ifndef TAO_PRINCIPAL_H
15 #define TAO_PRINCIPAL_H
17 #include /**/ "ace/pre.h"
19 #include "tao/CORBA_methods.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "tao/OctetSeqC.h"
26 #include "tao/Pseudo_VarOut_T.h"
27 #include "ace/Thread_Mutex.h"
28 #include <atomic>
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 namespace CORBA
34 class Principal;
35 typedef Principal *Principal_ptr;
37 typedef TAO_Pseudo_Var_T<Principal> Principal_var;
38 typedef TAO_Pseudo_Out_T<Principal> Principal_out;
40 /**
41 * @class Principal
43 * @brief A "Principal" identifies an authenticated entity in the
44 * network administration framework.
46 * Identities are used to control acccess (authorization) as well as
47 * in audit trails (accountability).
49 * @note This CORBA feature has been deprecated by the OMG. Use the
50 * CORBA Security Service instead.
52 class TAO_Export Principal
54 public:
55 // To applications, the identifier is an opaque ID.
57 // CORBA::SEQUENCE <CORBA::Octet> id;
58 CORBA::OctetSeq id;
60 // @@ add "==", "<", ">" operators
62 // The pseudo object operations.
63 static Principal * _duplicate (Principal *);
64 static Principal * _nil ();
66 // = Stuff required for memory management.
67 unsigned long _incr_refcount ();
68 unsigned long _decr_refcount ();
70 Principal ();
72 // Useful for template programming.
73 typedef Principal_ptr _ptr_type;
74 typedef Principal_var _var_type;
76 protected:
77 /// Destructor
78 /**
79 * Protected destructor to enforce proper memory management
80 * through the reference counting mechanism.
82 ~Principal ();
84 private:
85 // = Prevent copying
86 Principal &operator = (const CORBA::Principal_ptr &);
87 Principal (const CORBA::Principal_ptr &);
89 private:
90 /// Reference counter.
91 std::atomic<uint32_t> refcount_;
93 } // End CORBA namespace
95 TAO_Export CORBA::Boolean
96 operator<< (TAO_OutputCDR &, CORBA::Principal *);
98 TAO_Export CORBA::Boolean
99 operator>> (TAO_InputCDR &, CORBA::Principal *&);
101 TAO_END_VERSIONED_NAMESPACE_DECL
103 #if defined (__ACE_INLINE__)
104 # include "tao/Principal.inl"
105 #endif /* __ACE_INLINE__ */
107 #include /**/ "ace/post.h"
109 #endif /* TAO_PRINCIPAL_H */