limal-ca-mgm
ExtensionBase.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | ca-mgm library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: ExtensionBase.hpp
15 
16  Author: <Michael Calmer> <mc@suse.de>
17  Maintainer: <Michael Calmer> <mc@suse.de>
18 
19  Purpose:
20 
21 /-*/
22 #ifndef LIMAL_CA_MGM_EXTENSION_BASE_HPP
23 #define LIMAL_CA_MGM_EXTENSION_BASE_HPP
24 
25 #include <limal/ca-mgm/config.h>
27 #include <blocxx/COWIntrusiveReference.hpp>
28 
29 namespace LIMAL_NAMESPACE {
30 
31 namespace CA_MGM_NAMESPACE {
32 
33  class CA;
34  class ExtensionBaseImpl;
35 
36  class ExtensionBase {
37 
38  public:
39  ExtensionBase(bool extPresent = false, bool extCritical = false);
40 
41  ExtensionBase(const ExtensionBase& extension);
42 
43  virtual ~ExtensionBase();
44 
45 #ifndef SWIG
46 
47  ExtensionBase& operator=(const ExtensionBase& extension);
48 
49 #endif
50 
51  void setPresent(bool extPresent);
52  void setCritical(bool extCritical);
53 
54  bool isCritical() const;
55  bool isPresent() const;
56 
57  virtual void commit2Config(CA& ca, Type type) const = 0;
58 
59  virtual bool valid() const =0;
60  virtual blocxx::StringArray verify() const =0;
61 
62  virtual blocxx::StringArray dump() const;
63 
64  private:
65  blocxx::COWIntrusiveReference<ExtensionBaseImpl> m_impl;
66  };
67 
68 }
69 }
70 
71 #endif // LIMAL_CA_MGM_EXTENSION_BASE_HPP