moved ObjectProperty<> implementation to seperate file

world.hpp now uses forward decl. for many classes, this reduces built time!
see #43
Dieser Commit ist enthalten in:
Reinder Feenstra 2023-03-30 15:09:11 +02:00
Ursprung a52104f627
Commit 246b27c434
51 geänderte Dateien mit 337 neuen und 153 gelöschten Zeilen

Datei anzeigen

@ -21,9 +21,11 @@
*/
#include "board.hpp"
#include "boardlist.hpp"
#include "boardlisttablemodel.hpp"
#include "map/link.hpp"
#include "tile/tiles.hpp"
#include "../core/objectproperty.tpp"
#include "../world/world.hpp"
#include "../world/worldloader.hpp"
#include "../core/attributes.hpp"

Datei anzeigen

@ -21,6 +21,7 @@
*/
#include "signalpath.hpp"
#include "../../core/objectproperty.tpp"
#include "../tile/rail/blockrailtile.hpp"
#include "../tile/rail/turnout/turnoutrailtile.hpp"
#include "../tile/rail/directioncontrolrailtile.hpp"

Datei anzeigen

@ -21,6 +21,7 @@
*/
#include "blockrailtile.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../world/world.hpp"
#include "../../../core/attributes.hpp"
#include "../../../log/log.hpp"

Datei anzeigen

@ -21,6 +21,7 @@
*/
#include "decouplerrailtile.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../world/world.hpp"
#include "../../../core/attributes.hpp"
#include "../../../utils/displayname.hpp"

Datei anzeigen

@ -21,8 +21,10 @@
*/
#include "linkrailtile.hpp"
#include "../../list/linkrailtilelist.hpp"
#include "../../../core/attributes.hpp"
#include "../../../core/objectlisttablemodel.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../utils/displayname.hpp"
#include "../../../world/world.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "sensorrailtile.hpp"
#include "../../../world/world.hpp"
#include "../../../core/attributes.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../utils/sensor.hpp"
#include "../../../utils/displayname.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "signal2aspectrailtile.hpp"
#include "../../../map/signalpath.hpp"
#include "../../../../core/attributes.hpp"
#include "../../../../core/objectproperty.tpp"
static const std::array<SignalAspect, 3> aspectValues = {SignalAspect::Stop, SignalAspect::Proceed, SignalAspect::Unknown};
static const std::array<SignalAspect, 2> setAspectValues = {SignalAspect::Stop, SignalAspect::Proceed};

Datei anzeigen

@ -23,6 +23,7 @@
#include "signal3aspectrailtile.hpp"
#include "../../../map/signalpath.hpp"
#include "../../../../core/attributes.hpp"
#include "../../../../core/objectproperty.tpp"
static const std::array<SignalAspect, 4> aspectValues = {SignalAspect::Stop, SignalAspect::ProceedReducedSpeed, SignalAspect::Proceed, SignalAspect::Unknown};
static const std::array<SignalAspect, 3> setAspectValues = {SignalAspect::Stop, SignalAspect::ProceedReducedSpeed, SignalAspect::Proceed};

Datei anzeigen

@ -23,6 +23,7 @@
#include "signalrailtile.hpp"
#include "../../../map/signalpath.hpp"
#include "../../../../core/attributes.hpp"
#include "../../../../core/objectproperty.tpp"
#include "../../../../world/getworld.hpp"
#include "../../../../utils/displayname.hpp"

Datei anzeigen

@ -21,6 +21,7 @@
*/
#include "turnout3wayrailtile.hpp"
#include "../../../../core/objectproperty.tpp"
#include "../../../../core/attributes.hpp"
static const std::array<TurnoutPosition, 4> positionValues = {TurnoutPosition::Straight, TurnoutPosition::Left, TurnoutPosition::Right, TurnoutPosition::Unknown};

Datei anzeigen

@ -21,6 +21,7 @@
*/
#include "turnoutrailtile.hpp"
#include "../../../../core/objectproperty.tpp"
#include "../../../../core/attributes.hpp"
#include "../../../../world/world.hpp"
#include "../../../../utils/displayname.hpp"

Datei anzeigen

@ -35,6 +35,18 @@
return obj; \
}
#define CREATE_DEF(T) \
public: \
static std::shared_ptr<T> create(World& world, std::string_view _id);
#define CREATE_IMPL(T) \
std::shared_ptr<T> T::create(World& world, std::string_view _id) \
{ \
auto obj = std::make_shared<T>(world, _id); \
obj->addToWorld(); \
return obj; \
}
#define DEFAULT_ID(id) \
public: \
static constexpr std::string_view defaultId = id;

Datei anzeigen

@ -24,7 +24,6 @@
#define TRAINTASTIC_SERVER_CORE_OBJECTPROPERTY_HPP
#include "abstractobjectproperty.hpp"
#include "to.hpp"
#include <functional>
template<class T>
@ -40,147 +39,33 @@ class ObjectProperty : public AbstractObjectProperty
OnSet m_onSet;
public:
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags) :
AbstractObjectProperty(object, name, flags),
m_value{value}
{
}
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags);
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnChanged onChanged, OnSet onSet);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnChanged onChanged, OnSet onSet);
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnSet onSet);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnSet onSet);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags)
{
}
const std::shared_ptr<T>& value() const;
void setValue(const std::shared_ptr<T>& value);
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnChanged onChanged, OnSet onSet) :
ObjectProperty(object, name, value, flags)
{
m_onChanged = onChanged;
m_onSet = onSet;
}
void setValueInternal(std::nullptr_t);
void setValueInternal(const std::shared_ptr<T>& value);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnChanged onChanged, OnSet onSet) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags, onChanged, onSet)
{
}
/*inline*/ const T* operator ->() const;
/*inline*/ T* operator ->();
/*inline*/ const T& operator *() const;
/*inline*/ T& operator *();
ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnSet onSet) :
ObjectProperty(object, name, value, flags)
{
m_onSet = onSet;
}
/*inline*/ operator bool() const;
ObjectProperty<T>& operator =(const std::shared_ptr<T>& value);
ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnSet onSet) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags, onSet)
{
}
ObjectPtr toObject() const final;
const std::shared_ptr<T>& value() const
{
return m_value;
}
void setValue(const std::shared_ptr<T>& value)
{
assert(isWriteable());
if(m_value == value)
return;
else if(!isWriteable())
throw not_writable_error();
else if(!m_onSet || m_onSet(value))
{
m_value = value;
if(m_onChanged)
m_onChanged(m_value);
changed();
}
else
throw invalid_value_error();
/*
assert(isWriteable());
if(isWriteable() && (!m_onSet || m_onSet(value)))
setValueInternal(value);
*/
}
void setValueInternal(std::nullptr_t)
{
if(m_value)
{
m_value.reset();
changed();
}
}
void setValueInternal(const std::shared_ptr<T>& value)
{
if(m_value != value)
{
m_value = value;
changed();
}
}
inline const T* operator ->() const
{
return m_value.get();
}
inline T* operator ->()
{
return m_value.get();
}
inline const T& operator *() const
{
return *m_value;
}
inline T& operator *()
{
return *m_value;
}
inline operator bool() const
{
return m_value.operator bool();
}
ObjectProperty<T>& operator =(const std::shared_ptr<T>& value)
{
setValue(value);
return *this;
}
ObjectPtr toObject() const final
{
return std::dynamic_pointer_cast<Object>(m_value);
}
void fromObject(const ObjectPtr& value) final
{
if(value)
{
if(std::shared_ptr<T> v = std::dynamic_pointer_cast<T>(value))
setValue(v);
else
throw conversion_error();
}
else
setValue(nullptr);
}
void loadObject(const ObjectPtr& value) final
{
if(value)
{
if(std::shared_ptr<T> v = std::dynamic_pointer_cast<T>(value))
m_value = v;
else
throw conversion_error();
}
else
m_value.reset();
}
void fromObject(const ObjectPtr& value) final;
void loadObject(const ObjectPtr& value) final;
};
//#include "objectproperty.tpp"
#endif

Datei anzeigen

@ -0,0 +1,190 @@
/**
* server/src/core/objectproperty.tpp
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2019-2021,2023 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef TRAINTASTIC_SERVER_CORE_OBJECTPROPERTY_TPP
#define TRAINTASTIC_SERVER_CORE_OBJECTPROPERTY_TPP
#include "objectproperty.hpp"
#include "to.hpp"
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags) :
AbstractObjectProperty(object, name, flags),
m_value{value}
{
}
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags)
{
}
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnChanged onChanged, OnSet onSet) :
ObjectProperty(object, name, value, flags)
{
m_onChanged = onChanged;
m_onSet = onSet;
}
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnChanged onChanged, OnSet onSet) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags, onChanged, onSet)
{
}
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, const std::shared_ptr<T>& value, PropertyFlags flags, OnSet onSet) :
ObjectProperty(object, name, value, flags)
{
m_onSet = onSet;
}
template<class T>
ObjectProperty<T>::ObjectProperty(Object* object, std::string_view name, std::nullptr_t, PropertyFlags flags, OnSet onSet) :
ObjectProperty(object, name, std::shared_ptr<T>(), flags, onSet)
{
}
template<class T>
const std::shared_ptr<T>& ObjectProperty<T>::value() const
{
return m_value;
}
template<class T>
void ObjectProperty<T>::setValue(const std::shared_ptr<T>& value)
{
assert(isWriteable());
if(m_value == value)
return;
else if(!isWriteable())
throw not_writable_error();
else if(!m_onSet || m_onSet(value))
{
m_value = value;
if(m_onChanged)
m_onChanged(m_value);
changed();
}
else
throw invalid_value_error();
/*
assert(isWriteable());
if(isWriteable() && (!m_onSet || m_onSet(value)))
setValueInternal(value);
*/
}
template<class T>
void ObjectProperty<T>::setValueInternal(std::nullptr_t)
{
if(m_value)
{
m_value.reset();
changed();
}
}
template<class T>
void ObjectProperty<T>::setValueInternal(const std::shared_ptr<T>& value)
{
if(m_value != value)
{
m_value = value;
changed();
}
}
template<class T>
inline const T* ObjectProperty<T>::operator ->() const
{
return m_value.get();
}
template<class T>
inline T* ObjectProperty<T>::operator ->()
{
return m_value.get();
}
template<class T>
inline const T& ObjectProperty<T>::operator *() const
{
return *m_value;
}
template<class T>
inline T& ObjectProperty<T>::operator *()
{
return *m_value;
}
template<class T>
inline ObjectProperty<T>::operator bool() const
{
return m_value.operator bool();
}
template<class T>
ObjectProperty<T>& ObjectProperty<T>::operator =(const std::shared_ptr<T>& value)
{
setValue(value);
return *this;
}
template<class T>
ObjectPtr ObjectProperty<T>::toObject() const
{
return std::dynamic_pointer_cast<Object>(m_value);
}
template<class T>
void ObjectProperty<T>::fromObject(const ObjectPtr& value)
{
if(value)
{
if(std::shared_ptr<T> v = std::dynamic_pointer_cast<T>(value))
setValue(v);
else
throw conversion_error();
}
else
setValue(nullptr);
}
template<class T>
void ObjectProperty<T>::loadObject(const ObjectPtr& value)
{
if(value)
{
if(std::shared_ptr<T> v = std::dynamic_pointer_cast<T>(value))
m_value = v;
else
throw conversion_error();
}
else
m_value.reset();
}
#endif

Datei anzeigen

@ -29,6 +29,7 @@
#include "../protocol/dcc/dcc.hpp"
#include "../throttle/throttle.hpp"
#include "../../world/world.hpp"
#include "../../core/objectproperty.tpp"
#include "../../core/attributes.hpp"
#include "../../log/log.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -26,6 +26,7 @@
#include "list/decoderlist.hpp"
#include "list/decoderlisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../utils/almostzero.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "decoderchangeflags.hpp"
#include "../../world/world.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../log/logmessageexception.hpp"

Datei anzeigen

@ -21,10 +21,12 @@
*/
#include "identification.hpp"
#include "list/identificationlist.hpp"
#include "../../world/world.hpp"
#include "list/identificationlisttablemodel.hpp"
#include "../interface/loconetinterface.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "list/identificationlist.hpp"
#include "list/identificationlisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../utils/inrange.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -22,8 +22,10 @@
#include "input.hpp"
#include "../../world/world.hpp"
#include "list/inputlist.hpp"
#include "list/inputlisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -26,6 +26,7 @@
#include "list/inputlisttablemodel.hpp"
#include "monitor/inputmonitor.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../utils/inrange.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "../inputcontroller.hpp"
#include "../../../world/getworld.hpp"
#include "../../../core/attributes.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../utils/displayname.hpp"
InputList::InputList(Object& _parent, std::string_view parentPropertyName, InputListColumn _columns)

Datei anzeigen

@ -22,6 +22,7 @@
#include "inputlisttablemodel.hpp"
#include "inputlist.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../utils/displayname.hpp"
bool InputListTableModel::isListedProperty(std::string_view name)

Datei anzeigen

@ -21,11 +21,15 @@
*/
#include "dccplusplusinterface.hpp"
#include "../decoder/list/decoderlist.hpp"
#include "../decoder/list/decoderlisttablemodel.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../protocol/dccplusplus/messages.hpp"
#include "../protocol/dccplusplus/iohandler/serialiohandler.hpp"
#include "../protocol/dccplusplus/iohandler/simulationiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -21,10 +21,14 @@
*/
#include "ecosinterface.hpp"
#include "../decoder/list/decoderlist.hpp"
#include "../decoder/list/decoderlisttablemodel.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../protocol/ecos/iohandler/tcpiohandler.hpp"
#include "../protocol/ecos/iohandler/simulationiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "interface.hpp"
#include "interfacelisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -21,8 +21,12 @@
*/
#include "loconetinterface.hpp"
#include "../decoder/list/decoderlist.hpp"
#include "../decoder/list/decoderlisttablemodel.hpp"
#include "../input/input.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../identification/list/identificationlist.hpp"
#include "../identification/identification.hpp"
#include "../programming/lncv/lncvprogrammer.hpp"
#include "../protocol/loconet/iohandler/serialiohandler.hpp"
@ -31,6 +35,7 @@
#include "../protocol/loconet/iohandler/lbserveriohandler.hpp"
#include "../protocol/loconet/iohandler/z21iohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"
@ -42,6 +47,8 @@ constexpr auto inputListColumns = InputListColumn::Id | InputListColumn::Name |
constexpr auto outputListColumns = OutputListColumn::Id | OutputListColumn::Name | OutputListColumn::Address;
constexpr auto identificationListColumns = IdentificationListColumn::Id | IdentificationListColumn::Name | IdentificationListColumn::Interface | IdentificationListColumn::Address;
CREATE_IMPL(LocoNetInterface)
LocoNetInterface::LocoNetInterface(World& world, std::string_view _id)
: Interface(world, _id)
, DecoderController(*this, decoderListColumns)

Datei anzeigen

@ -49,7 +49,7 @@ class LocoNetInterface final
{
CLASS_ID("interface.loconet")
DEFAULT_ID("loconet")
CREATE(LocoNetInterface)
CREATE_DEF(LocoNetInterface)
private:
std::unique_ptr<LocoNet::Kernel> m_kernel;

Datei anzeigen

@ -21,11 +21,14 @@
*/
#include "traintasticdiyinterface.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../protocol/traintasticdiy/messages.hpp"
#include "../protocol/traintasticdiy/iohandler/serialiohandler.hpp"
#include "../protocol/traintasticdiy/iohandler/simulationiohandler.hpp"
#include "../protocol/traintasticdiy/iohandler/tcpiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "../protocol/withrottle/kernel.hpp"
#include "../protocol/withrottle/iohandler/tcpiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "wlanmausinterface.hpp"
#include "../protocol/z21/iohandler/udpserveriohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -21,7 +21,10 @@
*/
#include "xpressnetinterface.hpp"
#include "../decoder/list/decoderlist.hpp"
#include "../input/input.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../protocol/xpressnet/messages.hpp"
#include "../protocol/xpressnet/iohandler/serialiohandler.hpp"
#include "../protocol/xpressnet/iohandler/simulationiohandler.hpp"
@ -29,6 +32,7 @@
#include "../protocol/xpressnet/iohandler/rosofts88xpressnetliiohandler.hpp"
#include "../protocol/xpressnet/iohandler/tcpiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -21,10 +21,14 @@
*/
#include "z21interface.hpp"
#include "../decoder/list/decoderlist.hpp"
#include "../input/list/inputlist.hpp"
#include "../output/list/outputlist.hpp"
#include "../protocol/z21/messages.hpp"
#include "../protocol/z21/iohandler/simulationiohandler.hpp"
#include "../protocol/z21/iohandler/udpclientiohandler.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../log/logmessageexception.hpp"
#include "../../utils/category.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "../outputcontroller.hpp"
#include "../../../world/getworld.hpp"
#include "../../../core/attributes.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../utils/displayname.hpp"
OutputList::OutputList(Object& _parent, std::string_view parentPropertyName, OutputListColumn _columns)

Datei anzeigen

@ -21,9 +21,11 @@
*/
#include "output.hpp"
#include "list/outputlist.hpp"
#include "../../world/world.hpp"
#include "list/outputlisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../log/log.hpp"
#include "../../utils/displayname.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "list/outputlisttablemodel.hpp"
#include "keyboard/outputkeyboard.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
#include "../../utils/inrange.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -23,6 +23,7 @@
#include "lncvprogrammingcontroller.hpp"
#include "lncvprogrammer.hpp"
#include "../../../core/idobject.hpp"
#include "../../../core/objectproperty.tpp"
#include "../../../world/world.hpp"
bool LNCVProgrammingController::attachLNCVProgrammer(LNCVProgrammer& programmer)

Datei anzeigen

@ -24,6 +24,7 @@
#include "messages.hpp"
#include "../../decoder/decoder.hpp"
#include "../../decoder/decoderchangeflags.hpp"
#include "../../decoder/list/decoderlist.hpp"
#include "../../input/inputcontroller.hpp"
#include "../../output/outputcontroller.hpp"
#include "../../../utils/inrange.hpp"

Datei anzeigen

@ -22,6 +22,8 @@
#include "hardwarethrottle.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../hardware/decoder/list/decoderlist.hpp"
#include "../../utils/displayname.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -22,6 +22,7 @@
#include "throttle.hpp"
#include "../../core/attributes.hpp"
#include "../../hardware/decoder/decoder.hpp"
#include "../../utils/displayname.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -25,6 +25,7 @@
#include "list/throttlelist.hpp"
#include "list/throttlelisttablemodel.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
ThrottleController::ThrottleController(IdObject& interface, ThrottleListColumn columns)

Datei anzeigen

@ -24,6 +24,7 @@
#include "push.hpp"
#include "object.hpp"
#include "checkarguments.hpp"
#include "sandbox.hpp"
#include "../board/board.hpp"
#include "../board/boardlist.hpp"

Datei anzeigen

@ -33,6 +33,7 @@
#include "enums.hpp"
#include "sets.hpp"
#include "getversion.hpp"
#include "script.hpp"
#include <version.hpp>
#include <traintastic/utils/str.hpp>
#include "../world/world.hpp"

Datei anzeigen

@ -28,6 +28,7 @@
#include "../enum/worldevent.hpp"
#include "../set/worldstate.hpp"
#include "../core/attributes.hpp"
#include "../core/objectproperty.tpp"
#include "../world/worldloader.hpp"
#include "../world/worldsaver.hpp"
#include "../utils/displayname.hpp"

Datei anzeigen

@ -30,10 +30,14 @@
#ifndef NDEBUG
#include "../core/eventloop.hpp" // for: isEventLoopThread()
#endif
#include "../core/objectproperty.tpp"
#include "../core/tablemodel.hpp"
#include "../log/log.hpp"
#include "../log/memorylogger.hpp"
#include "../board/board.hpp"
#include "../board/tile/tiles.hpp"
#include "../hardware/input/monitor/inputmonitor.hpp"
#include "../hardware/output/keyboard/outputkeyboard.hpp"
#ifdef GetObject
#undef GetObject // GetObject is defined by a winapi header

Datei anzeigen

@ -21,9 +21,11 @@
*/
#include "train.hpp"
#include "trainlist.hpp"
#include "../world/world.hpp"
#include "trainlisttablemodel.hpp"
#include "../core/attributes.hpp"
#include "../core/objectproperty.tpp"
#include "../core/eventloop.hpp"
#include "../vehicle/rail/poweredrailvehicle.hpp"
#include "../utils/almostzero.hpp"

Datei anzeigen

@ -31,6 +31,7 @@
#include "../core/eventloop.hpp"
#include "../network/server.hpp"
#include "../core/attributes.hpp"
#include "../core/objectproperty.tpp"
#include "../world/world.hpp"
#include "../world/worldlist.hpp"
#include "../world/worldloader.hpp"

Datei anzeigen

@ -22,6 +22,7 @@
#include "poweredrailvehicle.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/almostzero.hpp"
#include "../../utils/displayname.hpp"
#include "../../world/world.hpp"

Datei anzeigen

@ -21,9 +21,11 @@
*/
#include "railvehicle.hpp"
#include "railvehiclelist.hpp"
#include "railvehiclelisttablemodel.hpp"
#include "../../world/world.hpp"
#include "../../core/attributes.hpp"
#include "../../core/objectproperty.tpp"
#include "../../utils/displayname.hpp"
RailVehicle::RailVehicle(World& world, std::string_view _id) :

Datei anzeigen

@ -29,6 +29,7 @@
#include <boost/uuid/uuid_io.hpp>
#include "worldsaver.hpp"
#include "../board/tile/rail/linkrailtile.hpp"
#include "../core/objectproperty.tpp"
#include "../core/objectlisttablemodel.hpp"
#include "../core/attributes.hpp"
#include "../core/abstractvectorproperty.hpp"
@ -40,6 +41,23 @@
#include "../utils/displayname.hpp"
#include "../traintastic/traintastic.hpp"
#include "../clock/clock.hpp"
#include "../board/boardlist.hpp"
#include "../board/list/linkrailtilelist.hpp"
#include "../hardware/interface/interfacelist.hpp"
#include "../hardware/decoder/list/decoderlist.hpp"
//#include "../hardware/decoder/decodercontroller.hpp"
#include "../hardware/identification/list/identificationlist.hpp"
//#include "../hardware/identification/identificationcontroller.hpp"
#include "../hardware/input/list/inputlist.hpp"
//#include "../hardware/input/inputcontroller.hpp"
#include "../hardware/output/list/outputlist.hpp"
//#include "../hardware/output/outputcontroller.hpp"
#include "../hardware/programming/lncv/lncvprogrammingcontroller.hpp"
#include "../train/trainlist.hpp"
#include "../vehicle/rail/railvehiclelist.hpp"
#include "../lua/scriptlist.hpp"
using nlohmann::json;
constexpr auto decoderListColumns = DecoderListColumn::Id | DecoderListColumn::Name | DecoderListColumn::Interface | DecoderListColumn::Address;

Datei anzeigen

@ -27,6 +27,7 @@
#include "../core/property.hpp"
#include "../core/objectproperty.hpp"
#include "../core/controllerlist.hpp"
#include "../core/method.hpp"
#include "../core/event.hpp"
#include <traintastic/utils/stdfilesystem.hpp>
#include <unordered_map>
@ -34,26 +35,28 @@
#include <traintastic/enum/worldevent.hpp>
#include "../enum/worldscale.hpp"
#include <traintastic/set/worldstate.hpp>
#include "../clock/clock.hpp"
#include "../board/boardlist.hpp"
#include "../board/list/linkrailtilelist.hpp"
#include "../hardware/interface/interfacelist.hpp"
#include "../hardware/decoder/list/decoderlist.hpp"
#include "../hardware/decoder/decodercontroller.hpp"
#include "../hardware/identification/list/identificationlist.hpp"
#include "../hardware/identification/identificationcontroller.hpp"
#include "../hardware/input/list/inputlist.hpp"
#include "../hardware/input/inputcontroller.hpp"
#include "../hardware/output/list/outputlist.hpp"
#include "../hardware/output/outputcontroller.hpp"
#include "../hardware/programming/lncv/lncvprogrammingcontroller.hpp"
#include "../train/trainlist.hpp"
#include "../vehicle/rail/railvehiclelist.hpp"
#include "../lua/scriptlist.hpp"
class WorldLoader;
class LinkRailTile;
class LNCVProgrammer;
class DecoderController;
class InputController;
class OutputController;
class IdentificationController;
class LNCVProgrammingController;
class InterfaceList;
class DecoderList;
class InputList;
class OutputList;
class IdentificationList;
class BoardList;
class Clock;
class TrainList;
class RailVehicleList;
namespace Lua {
class ScriptList;
}
class LinkRailTileList;
class World : public Object
{