summaryrefslogtreecommitdiff
path: root/ace/Service_Object.cpp
blob: 4b8163ffad845649fdb7b128685308c164c91cb2 (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
83
84
85
86
87
88
// $Id$

// Service_Object.cpp

#define ACE_BUILD_DLL
#include "ace/Service_Types.h"
#include "ace/Service_Object.h"

#if !defined (__ACE_INLINE__)
#include "ace/Service_Object.i"
#endif /* __ACE_INLINE__ */

ACE_ALLOC_HOOK_DEFINE(ACE_Service_Object)
ACE_ALLOC_HOOK_DEFINE(ACE_Service_Type)

void
ACE_Service_Type::dump (void) const
{
  ACE_TRACE ("ACE_Service_Type::dump");
}

ACE_Service_Type::ACE_Service_Type (const ASYS_TCHAR *n,
				    ACE_Service_Type_Impl *t,
				    const ACE_SHLIB_HANDLE h,
				    int active)
  : name_ (0),
#if defined (ACE_HAS_MOSTLY_UNICODE_APIS)
    chname_ (0),
#endif /* ACE_HAS_MOSTLY_UNICODE_APIS */
    type_ (t),
    handle_ (h),
    active_ (active)
{
  ACE_TRACE ("ACE_Service_Type::ACE_Service_Type");
  this->name (n);
}

ACE_Service_Type::~ACE_Service_Type (void)
{
  ACE_TRACE ("ACE_Service_Type::~ACE_Service_Type");
  this->type_->fini ();
  if (this->handle_ != 0)
    ACE_OS::dlclose ((ACE_SHLIB_HANDLE) this->handle_);
  delete [] (ASYS_TCHAR *) this->name_;
#if defined (ACE_HAS_MOSTLY_UNICODE_APIS)
  delete [] (char *) this->chname_;
#endif /* ACE_HAS_MOSTLY_UNICODE_APIS */
}

void
ACE_Service_Type::suspend (void) const
{
  ACE_TRACE ("ACE_Service_Type::suspend");
  ((ACE_Service_Type *) this)->active_ = 0;
  this->type_->suspend ();
}

void
ACE_Service_Type::resume (void) const
{
  ACE_TRACE ("ACE_Service_Type::resume");
  ((ACE_Service_Type *) this)->active_ = 1;
  this->type_->resume ();
}

ACE_Service_Object::ACE_Service_Object (void)
{
  ACE_TRACE ("ACE_Service_Object::ACE_Service_Object");
}

ACE_Service_Object::~ACE_Service_Object (void)
{
  ACE_TRACE ("ACE_Service_Object::~ACE_Service_Object");
}

int
ACE_Service_Object::suspend (void)
{
  ACE_TRACE ("ACE_Service_Object::suspend");
  return 0;
}

int
ACE_Service_Object::resume (void)
{
  ACE_TRACE ("ACE_Service_Object::resume");
  return 0;
}