]> granicus.if.org Git - icinga2/blobdiff - lib/base/type.hpp
Remove unused #includes
[icinga2] / lib / base / type.hpp
index f1b006daf3d4afc40d6593cdb15281e91792cc5e..b825b440d6ec089b19e67610374c70253c48765a 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)    *
+ * Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org)    *
  *                                                                            *
  * This program is free software; you can redistribute it and/or              *
  * modify it under the terms of the GNU General Public License                *
 #include "base/string.hpp"
 #include "base/object.hpp"
 #include "base/initialize.hpp"
-#include <boost/function.hpp>
+#include <vector>
 
 namespace icinga
 {
 
+/* keep this in sync with tools/mkclass/classcompiler.hpp */
 enum FieldAttribute
 {
-       FAConfig = 1,
-       FAState = 2,
-       FAInternal = 32
+       FAEphemeral = 1,
+       FAConfig = 2,
+       FAState = 4,
+       FAInternal = 64,
+       FARequired = 512
 }; 
 
 class Type;
@@ -43,10 +46,11 @@ struct Field
        int ID;
        const char *TypeName;
        const char *Name;
+       const char *RefTypeName;
        int Attributes;
 
-       Field(int id, const char *type, const char *name, int attributes)
-               : ID(id), TypeName(type), Name(name), Attributes(attributes)
+       Field(int id, const char *type, const char *name, const char *reftype, int attributes)
+               : ID(id), TypeName(type), Name(name), RefTypeName(reftype), Attributes(attributes)
        { }
 };
 
@@ -55,6 +59,12 @@ enum TypeAttribute
        TAAbstract = 1
 };
 
+class ValidationUtils
+{
+public:
+       virtual bool ValidateName(const String& type, const String& name) const = 0;
+};
+
 class I2_BASE_API Type : public Object
 {
 public:
@@ -84,6 +94,8 @@ public:
        virtual void SetField(int id, const Value& value);
        virtual Value GetField(int id) const;
 
+       virtual std::vector<String> GetLoadDependencies(void) const;
+
 protected:
        virtual ObjectFactory GetFactory(void) const = 0;
 
@@ -121,7 +133,7 @@ class TypeImpl
                        icinga::Type::Register(t); \
                } \
                \
-               INITIALIZE_ONCE(RegisterType ## type); \
+               INITIALIZE_ONCE_WITH_PRIORITY(RegisterType ## type, 10); \
        } } \
        DEFINE_TYPE_INSTANCE(type)