Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Classes | Namespaces | Macros | Typedefs | Functions
TYElement.h File Reference
#include <memory>
#include <unordered_map>
#include <iostream>
#include <boost/exception/error_info.hpp>
#include <QDebug>
#include "Tympan/core/defines.h"
#include "Tympan/core/macros.h"
#include "Tympan/core/idgen.h"
#include "Tympan/models/business/TYNameManager.h"
#include "TYDefines.h"
#include "TYXMLTools.h"
Include dependency graph for TYElement.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OPrototype
 
class  OPrototype::IOProtoFactory
 
class  OPrototype::Factory< T >
 
class  TYElement
 

Namespaces

 tympan
 

Macros

#define TYDIRPREFERENCEMANAGER   "UserPreferences"
 
#define OPROTODECL(classname)
 
#define TY_EXTENSION_DECL(classname)
 
#define TY_EXTENSION_DECL_ONLY(classname)
 
#define TY_EXTENSION_INST(classname)
 
#define TY_EXT_GRAPHIC_DECL(classname)
 
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
 
#define TY_EXT_GRAPHIC_INST(classname)
 
#define debugXml(expr)   _debugXml(#expr, (expr))
 

Typedefs

typedef boost::error_info< struct tag_classname, std::string > tympan::oproto_classname_errinfo
 
typedef std::vector< LPTYElementLPTYElementArray
 
typedef std::map< TYUUID, TYElement * > TYElementContainer
 
typedef void * LPTYElementGraphic
 
typedef class OGenID TYUUID
 

Functions

template<typename T >
std::unique_ptr< OPrototype::Factory< T > > build_factory ()
 
template<typename T >
T * downcast (TYElement *elt)
 
const char * str_qt2c (const QString &qstr)
 
QString xml2qstring (const QDomNode &node)
 
const char * xml2cstring (const QDomNode &node)
 
QDebug _debugXml (const char *expr, const QDomNode &node)
 

Macro Definition Documentation

◆ debugXml

#define debugXml (   expr)    _debugXml(#expr, (expr))

Definition at line 1036 of file TYElement.h.

◆ OPROTODECL

#define OPROTODECL (   classname)
Value:
public: \
virtual OPrototype* clone() const \
{ \
return new classname(); \
} \
virtual const char* getClassName() const \
{ \
return #classname; \
} \
static classname* safeDownCast(OPrototype* pObject) \
{ \
if (pObject) \
{ \
classname* pTypedObject = dynamic_cast<classname*>(pObject); \
if (pTypedObject != nullptr) \
{ \
return pTypedObject; \
} \
} \
return nullptr; \
}

Macro pour la declaration des methodes a surcharger de la classe OPrototype, et pour la registration du type 'classname' dans la Prototype Factory. Cette macro doit etre appelee dans la declaration de la nouvelle classe derivee (.h).

Definition at line 65 of file TYElement.h.

◆ TY_EXT_GRAPHIC_DECL

#define TY_EXT_GRAPHIC_DECL (   classname)

Macro pour la declaration des methodes d'extension pour le graphique

Definition at line 431 of file TYElement.h.

◆ TY_EXT_GRAPHIC_DECL_ONLY

#define TY_EXT_GRAPHIC_DECL_ONLY (   classname)

Definition at line 432 of file TYElement.h.

◆ TY_EXT_GRAPHIC_INST

#define TY_EXT_GRAPHIC_INST (   classname)

Definition at line 433 of file TYElement.h.

◆ TY_EXTENSION_DECL

#define TY_EXTENSION_DECL (   classname)

Macro pour la declaration des methodes d'extension pour l'IHM et l'Impression.

Definition at line 385 of file TYElement.h.

◆ TY_EXTENSION_DECL_ONLY

#define TY_EXTENSION_DECL_ONLY (   classname)

Definition at line 386 of file TYElement.h.

◆ TY_EXTENSION_INST

#define TY_EXTENSION_INST (   classname)

Definition at line 387 of file TYElement.h.

◆ TYDIRPREFERENCEMANAGER

#define TYDIRPREFERENCEMANAGER   "UserPreferences"

Definition at line 52 of file TYElement.h.

Typedef Documentation

◆ LPTYElementArray

typedef std::vector<LPTYElement> LPTYElementArray

Definition at line 345 of file TYElement.h.

◆ LPTYElementGraphic

typedef void* LPTYElementGraphic

Definition at line 434 of file TYElement.h.

◆ TYElementContainer

typedef std::map<TYUUID, TYElement*> TYElementContainer

Definition at line 347 of file TYElement.h.

◆ TYUUID

typedef class OGenID TYUUID

Structure contenant un identifiant unique pour chaque TYElement.

Definition at line 434 of file TYElement.h.

Function Documentation

◆ _debugXml()

QDebug _debugXml ( const char *  expr,
const QDomNode &  node 
)
inline

Definition at line 1031 of file TYElement.h.

Here is the call graph for this function:

◆ build_factory()

template<typename T >
std::unique_ptr<OPrototype::Factory<T> > build_factory ( )

Template class method allowing to build a factory for a T class

Returns
a unique ptr on the build factory

CAUTION: T must inherit from OPrototype

Definition at line 340 of file TYElement.h.

◆ downcast()

template<typename T >
T* downcast ( TYElement elt)

Definition at line 442 of file TYElement.h.

◆ str_qt2c()

const char* str_qt2c ( const QString &  qstr)
inline

Definition at line 1012 of file TYElement.h.

Here is the caller graph for this function:

◆ xml2cstring()

const char* xml2cstring ( const QDomNode &  node)
inline

Definition at line 1025 of file TYElement.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xml2qstring()

QString xml2qstring ( const QDomNode &  node)
inline

Definition at line 1017 of file TYElement.h.

Here is the caller graph for this function: