Move implementation code from thpp files into separate files

fixes #8890
This commit is contained in:
Gunnar Beutner 2015-03-28 11:04:42 +01:00
parent 0771c9755a
commit 72a7b08480
69 changed files with 527 additions and 396 deletions

View File

@ -15,15 +15,15 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(application.ti application.thpp) mkclass_target(application.ti application.tcpp application.thpp)
mkclass_target(dynamicobject.ti dynamicobject.thpp) mkclass_target(dynamicobject.ti dynamicobject.tcpp dynamicobject.thpp)
mkclass_target(filelogger.ti filelogger.thpp) mkclass_target(filelogger.ti filelogger.tcpp filelogger.thpp)
mkclass_target(logger.ti logger.thpp) mkclass_target(logger.ti logger.tcpp logger.thpp)
mkclass_target(streamlogger.ti streamlogger.thpp) mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp)
mkclass_target(sysloglogger.ti sysloglogger.thpp) mkclass_target(sysloglogger.ti sysloglogger.tcpp sysloglogger.thpp)
set(base_SOURCES set(base_SOURCES
application.cpp application-version.cpp application.thpp array.cpp array-script.cpp boolean.cpp boolean-script.cpp console.cpp context.cpp application.cpp application.thpp application-version.cpp array.cpp array-script.cpp boolean.cpp boolean-script.cpp console.cpp context.cpp
convert.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp dynamicobject.cpp dynamicobject.thpp dynamictype.cpp convert.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp dynamicobject.cpp dynamicobject.thpp dynamictype.cpp
exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp
netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp object-script.cpp primitivetype.cpp process.cpp netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp object-script.cpp primitivetype.cpp process.cpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "base/application.hpp" #include "base/application.hpp"
#include "base/application.tcpp"
#include "base/stacktrace.hpp" #include "base/stacktrace.hpp"
#include "base/timer.hpp" #include "base/timer.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "base/dynamicobject.hpp" #include "base/dynamicobject.hpp"
#include "base/dynamicobject.tcpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/serializer.hpp" #include "base/serializer.hpp"
#include "base/netstring.hpp" #include "base/netstring.hpp"

View File

@ -17,6 +17,8 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/ ******************************************************************************/
#include "base/debuginfo.hpp"
namespace icinga namespace icinga
{ {

View File

@ -18,8 +18,8 @@
******************************************************************************/ ******************************************************************************/
#include "base/exception.hpp" #include "base/exception.hpp"
#include "base/dynamicobject.hpp"
#include <boost/thread/tss.hpp> #include <boost/thread/tss.hpp>
#include <boost/foreach.hpp>
#ifdef HAVE_CXXABI_H #ifdef HAVE_CXXABI_H
# include <cxxabi.h> # include <cxxabi.h>
@ -154,7 +154,7 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta
if (vex) { if (vex) {
DebugInfo di; DebugInfo di;
DynamicObject::Ptr dobj = dynamic_pointer_cast<DynamicObject>(vex->GetObject()); DynamicObject::Ptr dobj = vex->GetObject();
if (dobj) if (dobj)
di = dobj->GetDebugInfo(); di = dobj->GetDebugInfo();
@ -313,7 +313,7 @@ const char *posix_error::what(void) const throw()
return m_Message; return m_Message;
} }
ValidationError::ValidationError(const intrusive_ptr<ObjectImpl<DynamicObject> >& object, const std::vector<String>& attributePath, const String& message) ValidationError::ValidationError(const DynamicObject::Ptr& object, const std::vector<String>& attributePath, const String& message)
: m_Object(object), m_AttributePath(attributePath), m_Message(message) : m_Object(object), m_AttributePath(attributePath), m_Message(message)
{ {
String path; String path;
@ -342,7 +342,7 @@ const char *ValidationError::what(void) const throw()
return m_What.CStr(); return m_What.CStr();
} }
intrusive_ptr<ObjectImpl<DynamicObject> > ValidationError::GetObject(void) const DynamicObject::Ptr ValidationError::GetObject(void) const
{ {
return m_Object; return m_Object;
} }

View File

@ -27,6 +27,7 @@
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/debuginfo.hpp" #include "base/debuginfo.hpp"
#include "base/dictionary.hpp" #include "base/dictionary.hpp"
#include "base/dynamicobject.hpp"
#include <sstream> #include <sstream>
#include <boost/exception/errinfo_api_function.hpp> #include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp> #include <boost/exception/errinfo_errno.hpp>
@ -65,21 +66,18 @@ private:
bool m_IncompleteExpr; bool m_IncompleteExpr;
}; };
class DynamicObject;
template<> class ObjectImpl<DynamicObject>;
/* /*
* @ingroup base * @ingroup base
*/ */
class I2_BASE_API ValidationError : virtual public user_error class I2_BASE_API ValidationError : virtual public user_error
{ {
public: public:
ValidationError(const intrusive_ptr<ObjectImpl<DynamicObject> >& object, const std::vector<String>& attributePath, const String& message); ValidationError(const DynamicObject::Ptr& object, const std::vector<String>& attributePath, const String& message);
~ValidationError(void) throw(); ~ValidationError(void) throw();
virtual const char *what(void) const throw(); virtual const char *what(void) const throw();
intrusive_ptr<ObjectImpl<DynamicObject> > GetObject(void) const; DynamicObject::Ptr GetObject(void) const;
std::vector<String> GetAttributePath(void) const; std::vector<String> GetAttributePath(void) const;
String GetMessage(void) const; String GetMessage(void) const;
@ -87,7 +85,7 @@ public:
Dictionary::Ptr GetDebugHint(void) const; Dictionary::Ptr GetDebugHint(void) const;
private: private:
intrusive_ptr<ObjectImpl<DynamicObject> > m_Object; DynamicObject::Ptr m_Object;
std::vector<String> m_AttributePath; std::vector<String> m_AttributePath;
String m_Message; String m_Message;
String m_What; String m_What;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "base/filelogger.hpp" #include "base/filelogger.hpp"
#include "base/filelogger.tcpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#include "base/application.hpp" #include "base/application.hpp"

View File

@ -17,9 +17,10 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/ ******************************************************************************/
#include "base/logger.hpp"
#include "base/logger.tcpp"
#include "base/application.hpp" #include "base/application.hpp"
#include "base/streamlogger.hpp" #include "base/streamlogger.hpp"
#include "base/logger.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "base/streamlogger.hpp" #include "base/streamlogger.hpp"
#include "base/streamlogger.tcpp"
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"
#include "base/console.hpp" #include "base/console.hpp"

View File

@ -22,6 +22,8 @@
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#ifndef _WIN32 #ifndef _WIN32
#include "base/sysloglogger.tcpp"
using namespace icinga; using namespace icinga;
REGISTER_TYPE(SyslogLogger); REGISTER_TYPE(SyslogLogger);

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(checkercomponent.ti checkercomponent.thpp) mkclass_target(checkercomponent.ti checkercomponent.tcpp checkercomponent.thpp)
set(checker_SOURCES set(checker_SOURCES
checkercomponent.cpp checkercomponent.thpp checkercomponent.cpp checkercomponent.thpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "checker/checkercomponent.hpp" #include "checker/checkercomponent.hpp"
#include "checker/checkercomponent.tcpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"
#include "icinga/cib.hpp" #include "icinga/cib.hpp"
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"

View File

@ -31,6 +31,7 @@
#include "base/objectlock.hpp" #include "base/objectlock.hpp"
#include "base/console.hpp" #include "base/console.hpp"
#include "base/serializer.hpp" #include "base/serializer.hpp"
#include "base/exception.hpp"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>

View File

@ -15,10 +15,10 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(checkresultreader.ti checkresultreader.thpp) mkclass_target(checkresultreader.ti checkresultreader.tcpp checkresultreader.thpp)
mkclass_target(compatlogger.ti compatlogger.thpp) mkclass_target(compatlogger.ti compatlogger.tcpp compatlogger.thpp)
mkclass_target(externalcommandlistener.ti externalcommandlistener.thpp) mkclass_target(externalcommandlistener.ti externalcommandlistener.tcpp externalcommandlistener.thpp)
mkclass_target(statusdatawriter.ti statusdatawriter.thpp) mkclass_target(statusdatawriter.ti statusdatawriter.tcpp statusdatawriter.thpp)
set(compat_SOURCES set(compat_SOURCES
checkresultreader.cpp checkresultreader.thpp compatlogger.cpp checkresultreader.cpp checkresultreader.thpp compatlogger.cpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "compat/checkresultreader.hpp" #include "compat/checkresultreader.hpp"
#include "compat/checkresultreader.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/pluginutility.hpp" #include "icinga/pluginutility.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "compat/compatlogger.hpp" #include "compat/compatlogger.hpp"
#include "compat/compatlogger.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/checkcommand.hpp" #include "icinga/checkcommand.hpp"
#include "icinga/eventcommand.hpp" #include "icinga/eventcommand.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "compat/externalcommandlistener.hpp" #include "compat/externalcommandlistener.hpp"
#include "compat/externalcommandlistener.tcpp"
#include "icinga/externalcommandprocessor.hpp" #include "icinga/externalcommandprocessor.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "compat/statusdatawriter.hpp" #include "compat/statusdatawriter.hpp"
#include "compat/statusdatawriter.tcpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"
#include "icinga/cib.hpp" #include "icinga/cib.hpp"
#include "icinga/hostgroup.hpp" #include "icinga/hostgroup.hpp"

View File

@ -15,12 +15,12 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(dbconnection.ti dbconnection.thpp) mkclass_target(dbconnection.ti dbconnection.tcpp dbconnection.thpp)
mkembedconfig_target(db_ido-itl.conf db_ido-itl.cpp) mkembedconfig_target(db_ido-itl.conf db_ido-itl.cpp)
set(db_ido_SOURCES set(db_ido_SOURCES
commanddbobject.cpp dbconnection.cpp dbconnection.thpp dbconnection.thpp commanddbobject.cpp dbconnection.cpp dbconnection.thpp
db_ido-itl.cpp dbevents.cpp dbobject.cpp dbquery.cpp db_ido-itl.cpp dbevents.cpp dbobject.cpp dbquery.cpp
dbreference.cpp dbtype.cpp dbvalue.cpp endpointdbobject.cpp hostdbobject.cpp dbreference.cpp dbtype.cpp dbvalue.cpp endpointdbobject.cpp hostdbobject.cpp
hostgroupdbobject.cpp idochecktask.cpp servicedbobject.cpp hostgroupdbobject.cpp idochecktask.cpp servicedbobject.cpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "db_ido/dbconnection.hpp" #include "db_ido/dbconnection.hpp"
#include "db_ido/dbconnection.tcpp"
#include "db_ido/dbvalue.hpp" #include "db_ido/dbvalue.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"
#include "icinga/host.hpp" #include "icinga/host.hpp"

View File

@ -18,7 +18,7 @@
find_package(MySQL) find_package(MySQL)
if(MYSQL_FOUND) if(MYSQL_FOUND)
mkclass_target(idomysqlconnection.ti idomysqlconnection.thpp) mkclass_target(idomysqlconnection.ti idomysqlconnection.tcpp idomysqlconnection.thpp)
set(db_ido_mysql_SOURCES set(db_ido_mysql_SOURCES
idomysqlconnection.cpp idomysqlconnection.thpp idomysqlconnection.cpp idomysqlconnection.thpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"
#include "icinga/perfdatavalue.tcpp"
#include "db_ido/dbtype.hpp" #include "db_ido/dbtype.hpp"
#include "db_ido/dbvalue.hpp" #include "db_ido/dbvalue.hpp"
#include "db_ido_mysql/idomysqlconnection.hpp" #include "db_ido_mysql/idomysqlconnection.hpp"

View File

@ -18,7 +18,7 @@
find_package(PostgreSQL) find_package(PostgreSQL)
if(PostgreSQL_FOUND) if(PostgreSQL_FOUND)
mkclass_target(idopgsqlconnection.ti idopgsqlconnection.thpp) mkclass_target(idopgsqlconnection.ti idopgsqlconnection.tcpp idopgsqlconnection.thpp)
link_directories(${PostgreSQL_LIBRARY_DIRS}) link_directories(${PostgreSQL_LIBRARY_DIRS})
include_directories(${PostgreSQL_INCLUDE_DIRS}) include_directories(${PostgreSQL_INCLUDE_DIRS})

View File

@ -17,9 +17,10 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/ ******************************************************************************/
#include "db_ido_pgsql/idopgsqlconnection.hpp"
#include "db_ido_pgsql/idopgsqlconnection.tcpp"
#include "db_ido/dbtype.hpp" #include "db_ido/dbtype.hpp"
#include "db_ido/dbvalue.hpp" #include "db_ido/dbvalue.hpp"
#include "db_ido_pgsql/idopgsqlconnection.hpp"
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(demo.ti demo.thpp) mkclass_target(demo.ti demo.tcpp)
set(demo_SOURCES set(demo_SOURCES
demo.cpp demo.thpp demo.cpp demo.thpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "demo/demo.hpp" #include "demo/demo.hpp"
#include "demo/demo.tcpp"
#include "remote/apilistener.hpp" #include "remote/apilistener.hpp"
#include "remote/apifunction.hpp" #include "remote/apifunction.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(hello.ti hello.thpp) mkclass_target(hello.ti hello.tcpp hello.thpp)
mkembedconfig_target(hello-app.conf hello-app.cpp) mkembedconfig_target(hello-app.conf hello-app.cpp)

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "hello/hello.hpp" #include "hello/hello.hpp"
#include "hello/hello.tcpp"
#include "base/logger.hpp" #include "base/logger.hpp"
using namespace icinga; using namespace icinga;

View File

@ -15,28 +15,28 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(checkable.ti checkable.thpp) mkclass_target(checkable.ti checkable.tcpp checkable.thpp)
mkclass_target(checkcommand.ti checkcommand.thpp) mkclass_target(checkcommand.ti checkcommand.tcpp checkcommand.thpp)
mkclass_target(checkresult.ti checkresult.thpp) mkclass_target(checkresult.ti checkresult.tcpp checkresult.thpp)
mkclass_target(command.ti command.thpp) mkclass_target(command.ti command.tcpp command.thpp)
mkclass_target(comment.ti comment.thpp) mkclass_target(comment.ti comment.tcpp comment.thpp)
mkclass_target(dependency.ti dependency.thpp) mkclass_target(dependency.ti dependency.tcpp dependency.thpp)
mkclass_target(downtime.ti downtime.thpp) mkclass_target(downtime.ti downtime.tcpp downtime.thpp)
mkclass_target(eventcommand.ti eventcommand.thpp) mkclass_target(eventcommand.ti eventcommand.tcpp eventcommand.thpp)
mkclass_target(hostgroup.ti hostgroup.thpp) mkclass_target(hostgroup.ti hostgroup.tcpp hostgroup.thpp)
mkclass_target(host.ti host.thpp) mkclass_target(host.ti host.tcpp host.thpp)
mkclass_target(icingaapplication.ti icingaapplication.thpp) mkclass_target(icingaapplication.ti icingaapplication.tcpp icingaapplication.thpp)
mkclass_target(customvarobject.ti customvarobject.thpp) mkclass_target(customvarobject.ti customvarobject.tcpp customvarobject.thpp)
mkclass_target(icingastatuswriter.ti icingastatuswriter.thpp) mkclass_target(icingastatuswriter.ti icingastatuswriter.tcpp icingastatuswriter.thpp)
mkclass_target(notificationcommand.ti notificationcommand.thpp) mkclass_target(notificationcommand.ti notificationcommand.tcpp notificationcommand.thpp)
mkclass_target(notification.ti notification.thpp) mkclass_target(notification.ti notification.tcpp notification.thpp)
mkclass_target(perfdatavalue.ti perfdatavalue.thpp) mkclass_target(perfdatavalue.ti perfdatavalue.tcpp perfdatavalue.thpp)
mkclass_target(scheduleddowntime.ti scheduleddowntime.thpp) mkclass_target(scheduleddowntime.ti scheduleddowntime.tcpp scheduleddowntime.thpp)
mkclass_target(servicegroup.ti servicegroup.thpp) mkclass_target(servicegroup.ti servicegroup.tcpp servicegroup.thpp)
mkclass_target(service.ti service.thpp) mkclass_target(service.ti service.tcpp service.thpp)
mkclass_target(timeperiod.ti timeperiod.thpp) mkclass_target(timeperiod.ti timeperiod.tcpp timeperiod.thpp)
mkclass_target(usergroup.ti usergroup.thpp) mkclass_target(usergroup.ti usergroup.tcpp usergroup.thpp)
mkclass_target(user.ti user.thpp) mkclass_target(user.ti user.tcpp user.thpp)
mkembedconfig_target(icinga-app.conf icinga-app.cpp) mkembedconfig_target(icinga-app.conf icinga-app.cpp)
@ -45,11 +45,11 @@ set(icinga_SOURCES
checkable-flapping.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp checkable-flapping.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp
cib.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp cib.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp
dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp
externalcommandprocessor.cpp host.cpp host.thpp hostgroup.cpp hostgroup.thpp icingaapplication.cpp externalcommandprocessor.cpp host.cpp host.thpp hostgroup.cpp hostgroup.thpp icingaapplication.cpp icingaapplication.thpp
icingaapplication.thpp customvarobject.cpp customvarobject.thpp icingastatuswriter.cpp icingastatuswriter.thpp customvarobject.cpp customvarobject.thpp icingastatuswriter.cpp icingastatuswriter.thpp
legacytimeperiod.cpp macroprocessor.cpp notificationcommand.cpp notificationcommand.thpp notification.cpp legacytimeperiod.cpp macroprocessor.cpp notificationcommand.cpp notificationcommand.thpp notification.cpp notification.thpp
notification.thpp notification-apply.cpp objectutils.cpp perfdatavalue.cpp perfdatavalue.thpp pluginutility.cpp scheduleddowntime.cpp notification-apply.cpp objectutils.cpp perfdatavalue.cpp perfdatavalue.thpp pluginutility.cpp scheduleddowntime.cpp scheduleddowntime.thpp
scheduleddowntime.thpp scheduleddowntime-apply.cpp service-apply.cpp checkable-check.cpp checkable-comment.cpp scheduleddowntime-apply.cpp service-apply.cpp checkable-check.cpp checkable-comment.cpp
service.cpp service.thpp servicegroup.cpp servicegroup.thpp checkable-notification.cpp timeperiod.cpp timeperiod.thpp service.cpp service.thpp servicegroup.cpp servicegroup.thpp checkable-notification.cpp timeperiod.cpp timeperiod.thpp
user.cpp user.thpp usergroup.cpp usergroup.thpp icinga-app.cpp user.cpp user.thpp usergroup.cpp usergroup.thpp icinga-app.cpp
) )

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/checkable.hpp" #include "icinga/checkable.hpp"
#include "icinga/checkable.tcpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/exception.hpp" #include "base/exception.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/checkcommand.hpp" #include "icinga/checkcommand.hpp"
#include "icinga/checkcommand.tcpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/checkresult.hpp" #include "icinga/checkresult.hpp"
#include "icinga/checkresult.tcpp"
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/command.hpp" #include "icinga/command.hpp"
#include "icinga/command.tcpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"
#include "base/exception.hpp" #include "base/exception.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/comment.hpp" #include "icinga/comment.hpp"
#include "icinga/comment.tcpp"
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/customvarobject.hpp" #include "icinga/customvarobject.hpp"
#include "icinga/customvarobject.tcpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/function.hpp" #include "base/function.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/dependency.hpp" #include "icinga/dependency.hpp"
#include "icinga/dependency.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/exception.hpp" #include "base/exception.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/downtime.hpp" #include "icinga/downtime.hpp"
#include "icinga/downtime.tcpp"
#include "base/utility.hpp" #include "base/utility.hpp"
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/eventcommand.hpp" #include "icinga/eventcommand.hpp"
#include "icinga/eventcommand.tcpp"
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/host.hpp" #include "icinga/host.hpp"
#include "icinga/host.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/hostgroup.hpp" #include "icinga/hostgroup.hpp"
#include "icinga/pluginutility.hpp" #include "icinga/pluginutility.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/hostgroup.hpp" #include "icinga/hostgroup.hpp"
#include "icinga/hostgroup.tcpp"
#include "config/objectrule.hpp" #include "config/objectrule.hpp"
#include "config/configitem.hpp" #include "config/configitem.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"
#include "icinga/icingaapplication.tcpp"
#include "icinga/cib.hpp" #include "icinga/cib.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/icingastatuswriter.hpp" #include "icinga/icingastatuswriter.hpp"
#include "icinga/icingastatuswriter.tcpp"
#include "icinga/cib.hpp" #include "icinga/cib.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/notification.hpp" #include "icinga/notification.hpp"
#include "icinga/notification.tcpp"
#include "icinga/notificationcommand.hpp" #include "icinga/notificationcommand.hpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/notificationcommand.hpp" #include "icinga/notificationcommand.hpp"
#include "icinga/notificationcommand.tcpp"
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"
#include "icinga/perfdatavalue.tcpp"
#include "base/convert.hpp" #include "base/convert.hpp"
#include "base/exception.hpp" #include "base/exception.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/scheduleddowntime.hpp" #include "icinga/scheduleddowntime.hpp"
#include "icinga/scheduleddowntime.tcpp"
#include "icinga/legacytimeperiod.hpp" #include "icinga/legacytimeperiod.hpp"
#include "icinga/downtime.hpp" #include "icinga/downtime.hpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/service.tcpp"
#include "icinga/servicegroup.hpp" #include "icinga/servicegroup.hpp"
#include "icinga/scheduleddowntime.hpp" #include "icinga/scheduleddowntime.hpp"
#include "icinga/pluginutility.hpp" #include "icinga/pluginutility.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/servicegroup.hpp" #include "icinga/servicegroup.hpp"
#include "icinga/servicegroup.tcpp"
#include "config/objectrule.hpp" #include "config/objectrule.hpp"
#include "config/configitem.hpp" #include "config/configitem.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/timeperiod.hpp" #include "icinga/timeperiod.hpp"
#include "icinga/timeperiod.tcpp"
#include "icinga/legacytimeperiod.hpp" #include "icinga/legacytimeperiod.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/user.hpp" #include "icinga/user.hpp"
#include "icinga/user.tcpp"
#include "icinga/usergroup.hpp" #include "icinga/usergroup.hpp"
#include "icinga/notification.hpp" #include "icinga/notification.hpp"
#include "icinga/usergroup.hpp" #include "icinga/usergroup.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "icinga/usergroup.hpp" #include "icinga/usergroup.hpp"
#include "icinga/usergroup.tcpp"
#include "config/objectrule.hpp" #include "config/objectrule.hpp"
#include "config/configitem.hpp" #include "config/configitem.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(livestatuslistener.ti livestatuslistener.thpp) mkclass_target(livestatuslistener.ti livestatuslistener.tcpp livestatuslistener.thpp)
set(livestatus_SOURCES set(livestatus_SOURCES
aggregator.cpp andfilter.cpp attributefilter.cpp aggregator.cpp andfilter.cpp attributefilter.cpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "livestatus/livestatuslistener.hpp" #include "livestatus/livestatuslistener.hpp"
#include "livestatus/livestatuslistener.tcpp"
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"
#include "base/utility.hpp" #include "base/utility.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(notificationcomponent.ti notificationcomponent.thpp) mkclass_target(notificationcomponent.ti notificationcomponent.tcpp notificationcomponent.thpp)
set(notification_SOURCES set(notification_SOURCES
notificationcomponent.cpp notificationcomponent.thpp notificationcomponent.cpp notificationcomponent.thpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "notification/notificationcomponent.hpp" #include "notification/notificationcomponent.hpp"
#include "notification/notificationcomponent.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"

View File

@ -15,10 +15,10 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(gelfwriter.ti gelfwriter.thpp) mkclass_target(gelfwriter.ti gelfwriter.tcpp gelfwriter.thpp)
mkclass_target(graphitewriter.ti graphitewriter.thpp) mkclass_target(graphitewriter.ti graphitewriter.tcpp graphitewriter.thpp)
mkclass_target(opentsdbwriter.ti opentsdbwriter.thpp) mkclass_target(opentsdbwriter.ti opentsdbwriter.tcpp opentsdbwriter.thpp)
mkclass_target(perfdatawriter.ti perfdatawriter.thpp) mkclass_target(perfdatawriter.ti perfdatawriter.tcpp perfdatawriter.thpp)
set(perfdata_SOURCES set(perfdata_SOURCES
gelfwriter.cpp gelfwriter.thpp graphitewriter.cpp graphitewriter.thpp opentsdbwriter.cpp opentsdbwriter.thpp perfdatawriter.cpp perfdatawriter.thpp gelfwriter.cpp gelfwriter.thpp graphitewriter.cpp graphitewriter.thpp opentsdbwriter.cpp opentsdbwriter.thpp perfdatawriter.cpp perfdatawriter.thpp

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "perfdata/gelfwriter.hpp" #include "perfdata/gelfwriter.hpp"
#include "perfdata/gelfwriter.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/notification.hpp" #include "icinga/notification.hpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "perfdata/graphitewriter.hpp" #include "perfdata/graphitewriter.hpp"
#include "perfdata/graphitewriter.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "perfdata/opentsdbwriter.hpp" #include "perfdata/opentsdbwriter.hpp"
#include "perfdata/opentsdbwriter.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "perfdata/perfdatawriter.hpp" #include "perfdata/perfdatawriter.hpp"
#include "perfdata/perfdatawriter.tcpp"
#include "icinga/service.hpp" #include "icinga/service.hpp"
#include "icinga/macroprocessor.hpp" #include "icinga/macroprocessor.hpp"
#include "icinga/icingaapplication.hpp" #include "icinga/icingaapplication.hpp"

View File

@ -15,13 +15,13 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(apilistener.ti apilistener.thpp) mkclass_target(apilistener.ti apilistener.tcpp apilistener.thpp)
mkclass_target(endpoint.ti endpoint.thpp) mkclass_target(endpoint.ti endpoint.tcpp endpoint.thpp)
mkclass_target(zone.ti zone.thpp) mkclass_target(zone.ti zone.tcpp zone.thpp)
set(remote_SOURCES set(remote_SOURCES
apiclient.cpp apiclient-heartbeat.cpp apifunction.cpp apilistener.cpp apilistener-sync.cpp apiclient.cpp apiclient-heartbeat.cpp apifunction.cpp apilistener.cpp apilistener.thpp apilistener-sync.cpp
apilistener.thpp authority.cpp endpoint.cpp endpoint.thpp jsonrpc.cpp authority.cpp endpoint.cpp endpoint.thpp jsonrpc.cpp
messageorigin.cpp zone.cpp zone.thpp messageorigin.cpp zone.cpp zone.thpp
) )

View File

@ -23,6 +23,7 @@
#include "base/initialize.hpp" #include "base/initialize.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/utility.hpp"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
using namespace icinga; using namespace icinga;

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "remote/apilistener.hpp" #include "remote/apilistener.hpp"
#include "remote/apilistener.tcpp"
#include "remote/apiclient.hpp" #include "remote/apiclient.hpp"
#include "remote/endpoint.hpp" #include "remote/endpoint.hpp"
#include "remote/jsonrpc.hpp" #include "remote/jsonrpc.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "remote/endpoint.hpp" #include "remote/endpoint.hpp"
#include "remote/endpoint.tcpp"
#include "remote/apilistener.hpp" #include "remote/apilistener.hpp"
#include "remote/apiclient.hpp" #include "remote/apiclient.hpp"
#include "remote/zone.hpp" #include "remote/zone.hpp"

View File

@ -18,6 +18,7 @@
******************************************************************************/ ******************************************************************************/
#include "remote/zone.hpp" #include "remote/zone.hpp"
#include "remote/zone.tcpp"
#include "remote/apiclient.hpp" #include "remote/apiclient.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>

View File

@ -40,15 +40,12 @@ set_target_properties (
FOLDER Bin FOLDER Bin
) )
macro(MKCLASS_TARGET ClassInput ClassOutput) macro(MKCLASS_TARGET ClassInput ClassImplOutput ClassHeaderOutput)
add_custom_command( add_custom_command(
OUTPUT ${ClassOutput} OUTPUT ${ClassImplOutput} ${ClassHeaderOutput}
COMMAND mkclass COMMAND mkclass
ARGS ${ClassInput} > ${CMAKE_CURRENT_BINARY_DIR}/${ClassOutput}.tmp ARGS ${ClassInput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassImplOutput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassHeaderOutput}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${CMAKE_CURRENT_BINARY_DIR}/${ClassOutput}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${ClassOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkclass ${ClassInput} DEPENDS mkclass ${ClassInput}
) )
set_property(SOURCE ${ClassOutput} PROPERTY EXCLUDE_UNITY_BUILD)
endmacro() endmacro()

File diff suppressed because it is too large Load Diff

View File

@ -171,6 +171,13 @@ struct Rule
std::vector<Rule> Rules; std::vector<Rule> Rules;
}; };
enum ValidatorType
{
ValidatorField,
ValidatorArray,
ValidatorDictionary
};
struct Validator struct Validator
{ {
std::string Name; std::string Name;
@ -180,7 +187,7 @@ struct Validator
class ClassCompiler class ClassCompiler
{ {
public: public:
ClassCompiler(const std::string& path, std::istream *input); ClassCompiler(const std::string& path, std::istream& input, std::ostream& oimpl, std::ostream& oheader);
~ClassCompiler(void); ~ClassCompiler(void);
void Compile(void); void Compile(void);
@ -203,14 +210,21 @@ public:
void HandleCode(const std::string& code, const ClassDebugInfo& locp); void HandleCode(const std::string& code, const ClassDebugInfo& locp);
void HandleMissingValidators(void); void HandleMissingValidators(void);
static void CompileFile(const std::string& path); void CodeGenValidator(const std::string& name, const std::string& klass, const std::vector<Rule>& rules, const std::string& field, const FieldType& fieldType, ValidatorType validatorType);
static void CompileStream(const std::string& path, std::istream *stream); void CodeGenValidatorSubrules(const std::string& name, const std::string& klass, const std::vector<Rule>& rules);
static void CompileFile(const std::string& inputpath, const std::string& implpath,
const std::string& headerpath);
static void CompileStream(const std::string& path, std::istream& input,
std::ostream& oimpl, std::ostream& oheader);
static void OptimizeStructLayout(std::vector<Field>& fields); static void OptimizeStructLayout(std::vector<Field>& fields);
private: private:
std::string m_Path; std::string m_Path;
std::istream *m_Input; std::istream& m_Input;
std::ostream& m_Impl;
std::ostream& m_Header;
void *m_Scanner; void *m_Scanner;
std::map<std::pair<std::string, std::string>, Field> m_MissingValidators; std::map<std::pair<std::string, std::string>, Field> m_MissingValidators;

View File

@ -24,10 +24,10 @@ using namespace icinga;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
if (argc < 2) { if (argc < 4) {
std::cerr << "Syntax: " << argv[0] << " <file>" << std::endl; std::cerr << "Syntax: " << argv[0] << " <input> <output-impl> <output-header>" << std::endl;
return 1; return 1;
} }
ClassCompiler::CompileFile(argv[1]); ClassCompiler::CompileFile(argv[1], argv[2], argv[3]);
} }