GlobalObjects
Loading...
Searching...
No Matches
GloPersistent.h File Reference

Header for Persistent More...

#include "GloTypes.h"
#include "GloBasePersistent.h"
#include "GloPersObjectSpy.h"
#include "GloAttributeID.h"
#include "GloRecord.h"
#include "GloTOndemand.h"
#include "GloTPointerSet.h"
#include "GloTOndemandSet.h"
#include "GloTPointerList.h"
#include "GloTOndemandList.h"
#include "EuException.h"
#include <string>
#include <ctime>
#include <list>

Go to the source code of this file.

Classes

class  glo::Persistent
 The base class of the persistent classes. All persistent classes must be derived from this class to be able to process their objects in the database. More...
 

Namespaces

namespace  glo
 

Macros

#define GLO_ANNOTATE_ACCESS_SPECIFIER(x)
 
#define GLO_INDEX(...)
 
#define GLO_OBJECT(...)
 
#define GLO_PERSISTENT_AREA   GLO_ANNOTATE_ACCESS_SPECIFIER(x)
 
#define persistent   GLO_PERSISTENT_AREA
 
#define transient   GLO_PERSISTENT_AREA
 

Detailed Description

Header for Persistent

Author
Helmut Jakoby

Terms of License

This file is part of the GlobalObjects module.

GlobalObjects is free software:

This library 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.

GNU Affero General Public License Usage
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Please review the following information to ensure the GNU Affero General Public License requirements will be met: https://www.gnu.org/licenses/agpl-3.0.en.html .

Macro Definition Documentation

◆ GLO_ANNOTATE_ACCESS_SPECIFIER

#define GLO_ANNOTATE_ACCESS_SPECIFIER ( x)

◆ GLO_INDEX

#define GLO_INDEX ( ...)

To insert a GLO-specific index in the header of persistent classes. Examples:

  • GLO_INDEX( IndexName, ExampleClass.m_MyString20[20] );
    #define GLO_INDEX(...)
    Definition GloPersistent.h:127
    -> An index with the name 'IndexName' is created. The index is formed from the first 20 characters of the attribute ExampleClass.m_MyString.
  • GLO_INDEX( IndexName, ExampleClass.m_MyString[20] & ExampleClass.m_MyEmbedded.ExampleEmbeddedClass.m_MyValue[10], UNIQUE | DEU-1 | CASE_SENSITIVE | USE_DELIMITER );
    -> An index with the name 'IndexName' is created. The index is formed from the first 20 characters of the attribute ExampleClass.m_MyString and the first 10 characters of the attribute ExampleEmbeddedClass.m_MyValue of the embedded object ExampleClass.m_MyEmbedded.Furthermore, this index is unique (UNIQUE), the characters in the index are case-sensitive (CASE_SENSITIVE), all special characters of the German character set are converted to their ASCII equivalents (for example, 'Ä' becomes 'AE') (DEU-1) and the two strings are separated by a '|' (USE_DELIMITER).

See example in ExampleClass.h.

◆ GLO_OBJECT

#define GLO_OBJECT ( ...)
Value:
public: \
virtual unsigned long getGloClassID() const override; \
virtual int getTypeAsString( std::string & rsTypeName ) override; \
virtual int setGloAttribute( const glo::AttributeID & rAttributeID, void * pPara ) override; \
virtual void * getGloAttribute( const glo::AttributeID & rAttributeID ) override; \
virtual int setGloAttribute( const std::string & rstrAttributeName, void * pPara ) override; \
virtual void * getGloAttribute( const std::string & rstrAttributeName ) override; \
virtual bool isSameOrSuperClassFrom( const glo::Persistent * pPersistent ) const override; \
virtual bool isSameOrSuperClassFrom( const std::shared_ptr<glo::Persistent> spPersistent ) const override; \
virtual void _postAssign( glo::Base & rBase ) override; \
private:
This class reflects a unique ID of a class information attribute.
Definition GloAttributeID.h:74
This class is the interface to the persistent objects. Here "objects" can be registered,...
Definition GloBase.h:250
The base class of the persistent classes. All persistent classes must be derived from this class to b...
Definition GloPersistent.h:221

It declares the virtual methodes for the subclasses. Examples:

  • GLO_OBJECT( MyTestClass:Persistent );
    #define GLO_OBJECT(...)
    Definition GloPersistent.h:75
    -> MyTestClass derived from Persistent
  • GLO_OBJECT( MyClass:Test,Rest );
    -> MyClass derived from Test und Rest
  • GLO_OBJECT( MyClass::MyNestedClass:Persistent );
    -> MyClass::MyNestedClass derived from Persistent

See example in ExampleClass.h.

◆ GLO_PERSISTENT_AREA

#define GLO_PERSISTENT_AREA   GLO_ANNOTATE_ACCESS_SPECIFIER(x)

◆ persistent

#define persistent   GLO_PERSISTENT_AREA

Start sequence for the persistent attributes area.
Within the start sequence 'persistent' and end sequence 'transient' all attributes are considered for storage in GlobalObjects.
See example in ExampleClass.h.

See also
transient

◆ transient

#define transient   GLO_PERSISTENT_AREA

End sequence for the range of persistent attributes.
See description of persistent.