sipxportlib  Version 3.3
Plugin.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 #ifndef _PLUGIN_H_
11 #define _PLUGIN_H_
12 
13 // SYSTEM INCLUDES
14 // APPLICATION INCLUDES
15 #include "utl/UtlString.h"
16 class OsConfigDb;
17 
18 // DEFINES
19 // MACROS
20 // EXTERNAL FUNCTIONS
21 // EXTERNAL VARIABLES
22 // CONSTANTS
23 // STRUCTS
24 // TYPEDEFS
25 // FORWARD DECLARATIONS
26 class Plugin;
27 
54 class Plugin
55 {
56  public:
57 
58  typedef Plugin* (*Factory)(const UtlString& pluginName);
84  virtual ~Plugin()
86  {
87  };
88 
90  virtual void readConfig( OsConfigDb& configDb
92  ) = 0;
103 protected:
104 
106  Plugin(const UtlString& instanceName) :
107  mInstanceName(instanceName)
108  {
109  };
110 
113 
114 private:
115 
117  Plugin(const Plugin&);
118 
120  Plugin& operator=(const Plugin&);
121 
122 };
123 
124 #endif // _PLUGIN_H_
Definition: Plugin.h:54
Definition: UtlString.h:48
UtlString mInstanceName
The instance name from the configuration directive - for logging and other identification.
Definition: Plugin.h:109
Definition: OsConfigDb.h:67
Plugin(const UtlString &instanceName)
Derived constructors should be private so that only the Factory can call them.
Definition: Plugin.h:106
virtual void readConfig(OsConfigDb &configDb)=0
Read (or re-read) whatever configuration the plugin requires.
virtual ~Plugin()
The plugin destructor must be virtual.
Definition: Plugin.h:85