version 1.15, 2002/04/01 14:28:27
|
version 1.16, 2002/04/01 19:25:43
|
|
|
class ModuleController; | class ModuleController; |
| |
| |
class PEGASUS_COMMON_LINKAGE pegasus_module |
class PEGASUS_COMMON_LINKAGE pegasus_module : pegasus_authorization_handle |
{ | { |
private: | private: |
class PEGASUS_COMMON_LINKAGE module_rep |
class module_rep |
{ | { |
public: | public: |
module_rep(ModuleController *controller, | module_rep(ModuleController *controller, |
|
|
private: | private: |
module_rep(void); | module_rep(void); |
module_rep(const module_rep & ); | module_rep(const module_rep & ); |
module_rep& operator= (const module_rep & ); |
module_rep& operator= (const module_rep & rep) |
|
{ |
|
if( this != &rep ) |
|
{ |
|
_reference_count++; |
|
} |
|
return *this; |
|
} |
|
|
|
module_rep *operator=(const module_rep *rep) |
|
{ |
|
if( this != rep) |
|
{ |
|
_reference_count++; |
|
} |
|
return this; |
|
} |
|
|
| |
Mutex _thread_safety; | Mutex _thread_safety; |
ModuleController *_controller; | ModuleController *_controller; |
|
|
}; | }; |
| |
public: | public: |
|
typedef pegasus_authorization_handle Base; |
| |
pegasus_module(ModuleController *controller, | pegasus_module(ModuleController *controller, |
const String &id, | const String &id, |
|
|
| |
~pegasus_module(void); | ~pegasus_module(void); |
| |
|
virtual Boolean authorized(Uint32 operation); |
|
virtual Boolean authorized(void); |
|
|
pegasus_module & operator= (const pegasus_module & mod); | pegasus_module & operator= (const pegasus_module & mod); |
|
pegasus_module * operator= (const pegasus_module * mod); |
|
|
Boolean operator == (const pegasus_module *mod) const; | Boolean operator == (const pegasus_module *mod) const; |
Boolean operator == (const pegasus_module & mod) const ; | Boolean operator == (const pegasus_module & mod) const ; |
Boolean operator == (const String & mod) const; | Boolean operator == (const String & mod) const; |
|
|
// introspection interface | // introspection interface |
Boolean query_interface(const String & class_id, void **object_ptr) const; | Boolean query_interface(const String & class_id, void **object_ptr) const; |
| |
|
|
private: | private: |
| |
module_rep *_rep; | module_rep *_rep; |
|
|
void _send_async_callback(Uint32 msg_handle, Message *msg) ; | void _send_async_callback(Uint32 msg_handle, Message *msg) ; |
void _send_shutdown_notify(void); | void _send_shutdown_notify(void); |
Boolean _shutdown(void); | Boolean _shutdown(void); |
|
bitset<32> _allowed_operations; |
| |
void reference(void) { _rep->reference(); } | void reference(void) { _rep->reference(); } |
void dereference(void) { _rep->dereference(); } | void dereference(void) { _rep->dereference(); } |
|
|
| |
| |
private: | private: |
class PEGASUS_COMMON_LINKAGE client_handle : pegasus_authorization_handle |
class client_handle : pegasus_authorization_handle |
{ | { |
public: | public: |
typedef pegasus_authorization_handle Base; | typedef pegasus_authorization_handle Base; |
| |
client_handle(pegasus_base_identity & id) |
client_handle(void) |
|
:Base(new pegasus_internal_identity(peg_credential_types::SERVICE)), |
|
allowed_operations( GET_CLIENT_HANDLE | |
|
FIND_SERVICE | |
|
FIND_MODULE_IN_SERVICE | |
|
GET_MODULE_REFERENCE | |
|
CLIENT_SEND_WAIT | |
|
CLIENT_SEND_WAIT_MODULE | |
|
CLIENT_SEND_ASYNC | |
|
CLIENT_SEND_ASYNC_MODULE | |
|
CLIENT_BLOCKING_THREAD_EXEC | |
|
CLIENT_ASYNC_THREAD_EXEC) |
|
{ |
|
|
|
} |
|
|
|
client_handle(pegasus_base_identity *id) |
:Base(id) | :Base(id) |
{ | { |
|
if( id && (id->get_base_id_type() == peg_identity_types::INTERNAL )) |
|
{ |
|
if (id->get_base_cred_type() == peg_credential_types::SERVICE ) |
|
allowed_operations = ModuleController::CLIENT_SEND_WAIT | |
|
ModuleController::CLIENT_SEND_WAIT_MODULE | |
|
ModuleController::CLIENT_SEND_ASYNC | |
|
ModuleController::CLIENT_SEND_ASYNC_MODULE | |
|
ModuleController::CLIENT_BLOCKING_THREAD_EXEC | |
|
ModuleController::CLIENT_ASYNC_THREAD_EXEC; |
|
else |
|
allowed_operations = 0; |
|
} |
|
|
} | } |
~client_handle(void); | ~client_handle(void); |
virtual Boolean authorized(Uint32 operation); | virtual Boolean authorized(Uint32 operation); |
virtual Boolean authorized(void); | virtual Boolean authorized(void); |
| |
private: | private: |
bitset<32> allowed_operations; |
bitset<64> allowed_operations; |
}; | }; |
| |
public: | public: |