BankAndCustomer
Lade ...
Suche ...
Keine Treffer
SelfWatchingClassObjCreator.h
gehe zur Dokumentation dieser Datei
1// ****************************************************************************
2// Created by GlobalObjects source code generator version 1.1.0
3// Creation date: 2024.08.10 - 15:22:26
4// Database: "SelfWatchingClass"
5//
6// WARNING! All changes made in this file will be lost!
7// ****************************************************************************
8//-----------------------------------------------------------------------------
9#ifndef INC_SELFWATCHINGCLASSOBJCREATOR_H
10#define INC_SELFWATCHINGCLASSOBJCREATOR_H
11
12#include <EuException.h>
13#include <GloTypes.h>
14#include <GloObjCreator.h>
15#include <GloTAllSet.h>
16
17// include persistent classes
18#include "SelfWatchingClass.h"
19//-----------------------------------------------------------------------------
20//BaseVersion:1723296145
21//-----------------------------------------------------------------------------
23{
24 public:
25 static const unsigned long ClassID_AllClasses = 0;
26 static const unsigned long ClassID_glo_Persistent = 1; // glo::Persistent
27 static const unsigned long ClassID_SelfWatchingClass = 2; // SelfWatchingClass
28
30 inline virtual ~SelfWatchingClassObjCreator();
31
32 inline virtual std::string getBaseName() const;
33 inline virtual bool isKnownClassID( unsigned long ulClassID ) const;
34 inline virtual int getPersObject( glo::Persistent *& prNewObject, unsigned long ulClassID ) const;
35 inline virtual int getPersObject( std::shared_ptr< glo::Persistent > & rNewObject, unsigned long ulClassID ) const;
36 inline virtual unsigned long getClassID( glo::BaseAllSet * pAllSet ) const;
37 inline virtual ObjCreator * getCopy() const;
38};
39//-----------------------------------------------------------------------------
40#define SUPER ObjCreator
41//-----------------------------------------------------------------------------
46//-----------------------------------------------------------------------------
50//-----------------------------------------------------------------------------
52{
53 return "SelfWatchingClass";
54}
55//-----------------------------------------------------------------------------
56inline bool SelfWatchingClassObjCreator::isKnownClassID( unsigned long ulClassID ) const
57{
58 if (
59 ulClassID == ClassID_glo_Persistent // 1 -> glo::Persistent
60 ||
61 ulClassID == ClassID_SelfWatchingClass // 2 -> SelfWatchingClass
62 )
63 {
64 return true;
65 }
66 return false;
67}
68//-----------------------------------------------------------------------------
69inline int SelfWatchingClassObjCreator::getPersObject( glo::Persistent *& prNewObject, unsigned long ulClassID ) const
70{
71 int t_iErr = 0;
72 glo::ObjID t_NewObjID( ulClassID, 0, 0 );
73
74 switch ( ulClassID )
75 {
76 case ClassID_glo_Persistent: // 1 -> glo::Persistent
77 {
78 prNewObject = new glo::Persistent();
79 break;
80 }
81 case ClassID_SelfWatchingClass: // 2 -> SelfWatchingClass
82 {
83 prNewObject = new SelfWatchingClass();
84 break;
85 }
86 default:
87 {
88 t_iErr = glo::ERR_UNKNOWN_CLASSID;
89 break;
90 }
91 } // END switch ( ulClassID )
92 if ( prNewObject )
93 {
94 prNewObject->setGloAttribute( "glo::Persistent.m_ObjID", & t_NewObjID );
95 }
96 return t_iErr;
97}
98//-----------------------------------------------------------------------------
99inline int SelfWatchingClassObjCreator::getPersObject( std::shared_ptr< glo::Persistent > & rNewObject, unsigned long ulClassID ) const
100{
101 rNewObject.reset();
102
103 glo::Persistent * t_pPersistent = NULL_PTR;
104 int t_iErr = this->getPersObject( t_pPersistent, ulClassID );
105
106 if ( t_pPersistent )
107 {
108 rNewObject = std::shared_ptr< glo::Persistent >( t_pPersistent, glo::Forgeter< glo::Persistent >() );
109 }
110 return t_iErr;
111}
112//-----------------------------------------------------------------------------
113inline unsigned long SelfWatchingClassObjCreator::getClassID( glo::BaseAllSet * pAllSet ) const
114{
115 unsigned long t_ulRetVal = 0;
116
117 glo::TAllSet<glo::Persistent> * t_pCastgloPersistent = dynamic_cast<glo::TAllSet<glo::Persistent>*>(pAllSet);
118 glo::TAllSet<SelfWatchingClass> * t_pCastSelfWatchingClass = dynamic_cast<glo::TAllSet<SelfWatchingClass>*>(pAllSet);
119
120 if ( t_pCastgloPersistent ) t_ulRetVal = ClassID_glo_Persistent; // 1 -> glo::Persistent
121 if ( t_pCastSelfWatchingClass ) t_ulRetVal = ClassID_SelfWatchingClass; // 2 -> SelfWatchingClass
122 if ( ! t_ulRetVal )
123 {
124 throw eut::ErrorNException( "SelfWatchingClassObjCreator::getClassID( BaseAllSet * pAllSet ) const", glo::ERR_UNKNOWN_OBJECT_TYPE, __FILE__, __LINE__ );
125 }
126 return t_ulRetVal;
127}
128//-----------------------------------------------------------------------------
133//-----------------------------------------------------------------------------
134#undef SUPER
135//-----------------------------------------------------------------------------
136#endif
#define NULL_PTR
Definition EuDef_NULL_PTR.h:74
Header für ObjCreator
Header und Source für TAllSet
Header für SelfWatchingClass
#define SUPER
Definition SelfWatchingClassObjCreator.h:40
Beispiel einer selbstbeobachtenden Klasse, die ihre persistenten Attribute durch Aufrufen von refresh...
Definition SelfWatchingClass.h:93
Definition SelfWatchingClassObjCreator.h:23
static const unsigned long ClassID_AllClasses
Definition SelfWatchingClassObjCreator.h:25
virtual ~SelfWatchingClassObjCreator()
Definition SelfWatchingClassObjCreator.h:47
virtual int getPersObject(glo::Persistent *&prNewObject, unsigned long ulClassID) const
Definition SelfWatchingClassObjCreator.h:69
static const unsigned long ClassID_glo_Persistent
Definition SelfWatchingClassObjCreator.h:26
virtual std::string getBaseName() const
Definition SelfWatchingClassObjCreator.h:51
virtual bool isKnownClassID(unsigned long ulClassID) const
Definition SelfWatchingClassObjCreator.h:56
virtual ObjCreator * getCopy() const
Definition SelfWatchingClassObjCreator.h:129
virtual unsigned long getClassID(glo::BaseAllSet *pAllSet) const
Definition SelfWatchingClassObjCreator.h:113
SelfWatchingClassObjCreator()
Definition SelfWatchingClassObjCreator.h:42
static const unsigned long ClassID_SelfWatchingClass
Definition SelfWatchingClassObjCreator.h:27
Ist die Basisklasse von Template-AllSets und dem generischen AllSet.
Definition GloBaseAllSet.h:80
Abstrakte Oberklasse für Instanziierungsfunktionen der persistenten Klassen. Von dieser Klasse wird g...
Definition GloObjCreator.h:71
ObjCreator()
Definition GloObjCreator.h:84
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:77
Die Basisklasse der persistenten Klassen. Von dieser Klasse müssen alle persistenten Klassen abgeleit...
Definition GloPersistent.h:235
virtual int setGloAttribute(const AttributeID &rAttributeID, void *pPara)
AllSet, welcher Objekte aus der Datenbank liefert.
Definition GloTAllSet.h:185