summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h
blob: a3f0d8adf96c657273441e321dfb495a7683320d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* -*- C++ -*- */
// $Id$

// ============================================================================
// = LIBRARY
//   orbsvcs
//
// = FILENAME
//   LogMgr_i.h
//
// = DESCRIPTION
//   Implementation of the LogManager i,e DsLogAdmin::LogMgr interface.
//
// = AUTHOR
//    Matthew Braun (mjb2@cs.wustl.edu) and Pradeep Gore <pradeep@cs.wustl.edu>
//
// ============================================================================

#ifndef TLS_LOGMGR_I_H
#define TLS_LOGMGR_I_H
#include "ace/pre.h"

#include "orbsvcs/DsLogAdminS.h"
#include "orbsvcs/Log/BasicLog_i.h"
#include "log_export.h"

class TAO_Log_Export LogMgr_i : public virtual POA_DsLogAdmin::LogMgr
{
  // = TITLE
  //   LogMgr_i
  // = DESCRIPTION
  //   This class has methods to query for Log objects.
  //
public:
  // Initialization and Termination Methods
  LogMgr_i (void);
  // Constructor.

  ~LogMgr_i ();
  // Destructor.

  DsLogAdmin::LogList *
    list_logs (CORBA::Environment &ACE_TRY_ENV =
               CORBA::default_environment ())
    ACE_THROW_SPEC ((
                     CORBA::SystemException
                     ));
  // Lists all logs created by the log factory

  DsLogAdmin::Log_ptr
    find_log (DsLogAdmin::LogId id,
              CORBA::Environment &ACE_TRY_ENV =
              CORBA::default_environment ())
    ACE_THROW_SPEC ((
                     CORBA::SystemException
                     ));
  // Returns a reference to the log with the supplied id

  DsLogAdmin::LogIdList *
  list_logs_by_id (CORBA::Environment &ACE_TRY_ENV =
		   CORBA::default_environment ())
    ACE_THROW_SPEC ((
                     CORBA::SystemException
                     ));
  // Lists all log ids

 int remove (DsLogAdmin::LogId id);
 // remove the given entry from the hash table.

protected:
  typedef ACE_Hash_Map_Manager <DsLogAdmin::LogId,
    DsLogAdmin::BasicLog_var,TAO_SYNCH_MUTEX> HASHMAP;
  // Define the HASHMAP.

  HASHMAP hash_map_;
  // The map of Logs created.

  DsLogAdmin::LogId max_id_;
  // The Max id assigned so far.
};
#include "ace/post.h"
#endif /* TLS_LOGMGR_I_H */