dmlite
0.6
Main Page
Namespaces
Classes
Files
File List
File Members
include
dmlite
cpp
base.h
Go to the documentation of this file.
1
/// @file include/dmlite/cpp/base.h
2
/// @brief Base interfaces.
3
/// @author Alejandro Álvarez Ayllón <aalvarez@cern.ch>
4
#ifndef DMLITE_CPP_BASE_H
5
#define DMLITE_CPP_BASE_H
6
7
#include "../common/config.h"
8
#include "
exceptions.h
"
9
#include <string>
10
11
namespace
dmlite {
12
13
// Forward declarations.
14
class
StackInstance;
15
class
SecurityContext;
16
17
/// Base class for interfaces.
18
class
BaseInterface
{
19
public
:
20
/// Virtual destructor
21
virtual
~BaseInterface
();
22
23
/// String ID of the implementation.
24
virtual
std::string
getImplId
(
void
)
const
throw
() = 0;
25
26
protected
:
27
friend
class
StackInstance
;
28
29
/// Set the StackInstance.
30
/// Some plugins may need to access other stacks (i.e. the pool may need the catalog)
31
/// However, at construction time not all the stacks have been populated, so this will
32
/// be called once all are instantiated.
33
virtual
void
setStackInstance
(
StackInstance
* si)
throw
(
DmException
);
34
35
/// Set the security context.
36
virtual
void
setSecurityContext
(
const
SecurityContext
* ctx)
throw
(
DmException
);
37
38
/// These method allows plugins to call other plugins setStackInstance and setSecurityContext
39
static
void
setStackInstance
(
BaseInterface
* i,
40
StackInstance
* si)
throw
(
DmException
);
41
42
static
void
setSecurityContext
(
BaseInterface
* i,
43
const
SecurityContext
* ctx)
throw
(
DmException
);
44
};
45
46
47
/// Base class for factories.
48
class
BaseFactory
{
49
public
:
50
/// Virtual destructor
51
virtual
~BaseFactory
();
52
53
/// Set a configuration parameter
54
/// @param key The configuration parameter
55
/// @param value The value for the configuration parameter
56
virtual
void
configure
(
const
std::string& key,
const
std::string& value)
throw
(
DmException
);
57
};
58
59
};
60
61
#endif // DMLITE_CPP_BASE_H
Generated on Sun Mar 3 2013 12:58:00 for dmlite by
1.8.3.1