summaryrefslogtreecommitdiff
path: root/ace/Service_Object.cpp
blob: c5032bfcbb17c4ee232a2d9c92a800f87c8cb1d0 (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
// $Id$

// Service_Object.cpp

#define ACE_BUILD_DLL
#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_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;
}

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 void *so, 
				    const char *s_name, 
				    unsigned int f)
  : name_ (0),
    obj_ (so), 
    flags_ (f)
{
  ACE_TRACE ("ACE_Service_Type::ACE_Service_Type");
  this->name (s_name);
}

ACE_Service_Type::~ACE_Service_Type (void)
{
  ACE_TRACE ("ACE_Service_Type::~ACE_Service_Type");

  // It's ok to call this, even though we may have already deleted it
  // in the fini() method since it would then be NULL.
  delete [] (char *) this->name_;
}

int
ACE_Service_Type::fini (void) const
{
  ACE_TRACE ("ACE_Service_Type::fini");
  ACE_DEBUG ((LM_DEBUG, "destroying %s, flags = %d\n", 
	     this->name_, this->flags_));

  delete [] (char *) this->name_;
  ((ACE_Service_Type *) this)->name_ = 0;

  if (ACE_BIT_ENABLED (this->flags_, ACE_Service_Type::DELETE_OBJ))
    delete (void *) this->object ();

  if (ACE_BIT_ENABLED (this->flags_, ACE_Service_Type::DELETE_THIS))
    delete (ACE_Service_Type *) this; 

  return 0;
}