dmlite 0.6
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 "dmlite/common/config.h"
8#include "exceptions.h"
9#include <string>
10
11namespace dmlite {
12
13 // Forward declarations.
14 class StackInstance;
15 class SecurityContext;
16
17 /// Base class for interfaces.
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) ;
34
35 /// Set the security context.
36 virtual void setSecurityContext(const SecurityContext* ctx) ;
37
38 /// These method allows plugins to call other plugins setStackInstance and setSecurityContext
40 StackInstance* si) ;
41
43 const SecurityContext* ctx) ;
44 };
45
46
47 /// Base class for factories.
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) ;
57 };
58
59};
60
61#endif // DMLITE_CPP_BASE_H
Base class for factories.
Definition base.h:48
virtual ~BaseFactory()
Virtual destructor.
virtual void configure(const std::string &key, const std::string &value)
Base class for interfaces.
Definition base.h:18
virtual void setSecurityContext(const SecurityContext *ctx)
Set the security context.
virtual void setStackInstance(StackInstance *si)
virtual ~BaseInterface()
Virtual destructor.
static void setSecurityContext(BaseInterface *i, const SecurityContext *ctx)
virtual std::string getImplId(void) const =0
String ID of the implementation.
static void setStackInstance(BaseInterface *i, StackInstance *si)
These method allows plugins to call other plugins setStackInstance and setSecurityContext.
Security context. To be created by the Authn.
Definition authn.h:73
Definition dmlite.h:161
Exceptions used by the API.
Namespace for the dmlite C++ API.
Definition authn.h:16