3 #if !defined (ACE_LACKS_PRAGMA_ONCE)
5 #endif /* ACE_LACKS_PRAGMA_ONCE */
7 #include "tao/DynamicInterface/Dynamic_Implementation.h"
8 #include "tao/PortableServer/PortableServer.h"
9 #include "ace/Singleton.h"
10 #include "ace/Local_Memory_Pool.h"
11 #include "ace/Malloc_T.h"
17 //typedef ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> DATABASE_MALLOC;
18 typedef ACE_Malloc
<ACE_LOCAL_MEMORY_POOL
, ACE_Null_Mutex
> DATABASE_MALLOC
;
20 class Simpler_Database_Malloc
: public DATABASE_MALLOC
23 Simpler_Database_Malloc ();
24 ~Simpler_Database_Malloc ();
27 typedef ACE_Singleton
<Simpler_Database_Malloc
, ACE_Null_Mutex
> DATABASE
;
28 //typedef ACE_Malloc_Iterator<ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> DATABASE_ITERATOR;
29 typedef ACE_Malloc_Iterator
<ACE_LOCAL_MEMORY_POOL
, ACE_Null_Mutex
> DATABASE_ITERATOR
;
31 class Entry
: public TAO_DynamicImplementation
34 Entry (CORBA::ORB_ptr orb
,
35 PortableServer::POA_ptr poa
);
38 virtual void invoke (CORBA::ServerRequest_ptr request
);
39 // The invoke() method receives requests issued to any CORBA
40 // object incarnated by the DSI servant and performs the
41 // processing necessary to execute the request.
43 virtual CORBA::RepositoryId
_primary_interface (const PortableServer::ObjectId
&oid
,
44 PortableServer::POA_ptr poa
);
45 // The _primary_interface() method receives an ObjectId value and
46 // a POA_ptr as input parameters and returns a valid RepositoryId
47 // representing the most-derived interface for that oid.
49 virtual PortableServer::POA_ptr
_default_POA ();
50 // Returns the default POA for this servant.
52 virtual void is_a (CORBA::ServerRequest_ptr request
);
53 // Handles the _is_a call
59 PortableServer::POA_var poa_
;
62 PortableServer::Current_var poa_current_
;
66 class Agent
: public POA_Database::Agent
69 Agent (CORBA::ORB_ptr orb
,
70 PortableServer::POA_ptr poa
);
73 virtual Database::Entry_ptr
create_entry (const char *key
,
74 const char *entry_type
,
75 const Database::NVPairSequence
&initial_attributes
);
77 virtual Database::Entry_ptr
find_entry (const char *key
,
78 const char *entry_type
);
80 virtual void destroy_entry (const char *key
,
81 const char *entry_type
);
83 virtual void shutdown ();
85 virtual PortableServer::POA_ptr
_default_POA ();
86 // Returns the default POA for this servant.
92 PortableServer::POA_var poa_
;
95 Entry common_servant_
;
98 static char *entry_type_to_repository_id (const char *entry_type
);
103 Employee (const char* name
, CORBA::Long id
);
107 const char *name () const;
108 void name (const char* name
);
110 CORBA::Long
id () const;
111 void id (CORBA::Long id
);
113 /// Overloaded new operator, nothrow_t variant.
114 void *operator new (size_t bytes
, const std::nothrow_t
&nt
);
115 void operator delete (void *p
, const std::nothrow_t
&) noexcept
;
116 void *operator new (size_t);
117 void operator delete (void *pointer
);