Code_TYMPAN  4.2.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 947 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 67 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 414 of file TYElement.h.

◆ TY_EXT_GRAPHIC_DECL_ONLY

#define TY_EXT_GRAPHIC_DECL_ONLY (   classname)

Definition at line 415 of file TYElement.h.

◆ TY_EXT_GRAPHIC_INST

#define TY_EXT_GRAPHIC_INST (   classname)

Definition at line 416 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 374 of file TYElement.h.

◆ TY_EXTENSION_DECL_ONLY

#define TY_EXTENSION_DECL_ONLY (   classname)

Definition at line 375 of file TYElement.h.

◆ TY_EXTENSION_INST

#define TY_EXTENSION_INST (   classname)

Definition at line 376 of file TYElement.h.

◆ TYDIRPREFERENCEMANAGER

#define TYDIRPREFERENCEMANAGER   "UserPreferences"

Definition at line 54 of file TYElement.h.

Typedef Documentation

◆ LPTYElementArray

typedef std::vector<LPTYElement> LPTYElementArray

Definition at line 338 of file TYElement.h.

◆ LPTYElementGraphic

typedef void* LPTYElementGraphic

Definition at line 417 of file TYElement.h.

◆ TYElementContainer

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

Definition at line 340 of file TYElement.h.

◆ TYUUID

typedef class OGenID TYUUID

Structure contenant un identifiant unique pour chaque TYElement.

Definition at line 423 of file TYElement.h.

Function Documentation

◆ _debugXml()

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

Definition at line 944 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 336 of file TYElement.h.

◆ downcast()

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

Definition at line 427 of file TYElement.h.

◆ str_qt2c()

const char* str_qt2c ( const QString &  qstr)
inline

Definition at line 930 of file TYElement.h.

Here is the caller graph for this function:

◆ xml2cstring()

const char* xml2cstring ( const QDomNode &  node)
inline

Definition at line 940 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 933 of file TYElement.h.

Here is the caller graph for this function: