diff options
author | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-11-19 16:23:15 +0000 |
---|---|---|
committer | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-11-19 16:23:15 +0000 |
commit | 8e1cff695608fa8cb8070fefd462362fc6900227 (patch) | |
tree | 78fd957a0cf61edd5e1f98b60c00b06b2d5015bf /ace/Dynamic_Service_Base.cpp | |
parent | 8097ea1d4e3542c9de9bae388e705c7a3a6bce37 (diff) | |
download | ATCD-8e1cff695608fa8cb8070fefd462362fc6900227.tar.gz |
ChangeLogTag: Sun Nov 19 08:05:08 2000 Priyanka Gontla <pgontla@ece.uci.edu>
Diffstat (limited to 'ace/Dynamic_Service_Base.cpp')
-rw-r--r-- | ace/Dynamic_Service_Base.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ace/Dynamic_Service_Base.cpp b/ace/Dynamic_Service_Base.cpp new file mode 100644 index 00000000000..61950a686cc --- /dev/null +++ b/ace/Dynamic_Service_Base.cpp @@ -0,0 +1,51 @@ +// $Id$ + +#ifndef ACE_DYNAMIC_SERVICE_BASE_C +#define ACE_DYNAMIC_SERVICE_BASE_C + +#include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Service_Repository.h" +#include "ace/Dynamic_Service_Base.h" +#include "ace/Log_Msg.h" + +ACE_RCSID(ace, Dynamic_Service_Base, "$Id$") + +void +ACE_Dynamic_Service_Base::dump (void) const +{ + ACE_TRACE ("ACE_Dynamic_Service_Base::dump"); + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +// Get the instance using <name>. + +void * +ACE_Dynamic_Service_Base::instance (const ACE_TCHAR *name) +{ + ACE_TRACE ("ACE_Dynamic_Service_Base::instance"); + const ACE_Service_Type *svc_rec; + + if (ACE_Service_Repository::instance ()->find (name, + &svc_rec) == -1) + return 0; + + const ACE_Service_Type_Impl *type = svc_rec->type (); + + if (type == 0) + return 0; + else + { + void *obj = type->object (); + return obj; + } +} + +#endif /* ACE_DYNAMIC_SERVICE_BASE_C */ |