OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
property.h File Reference

Credits: The Property pattern is taken from "Patterns in Practice: A Property Template for C++", from "C++ Report", Nov/Dec 1995, p. More...

#include <owl/private/defs.h>
#include <owl/functor.h>
#include <owl/preclass.h>
#include <owl/posclass.h>

Go to the source code of this file.

Classes

class  owl::TProperty< T >
 simple type/pointer More...
 
class  owl::TConstProperty< T >
 
class  owl::TObjProperty< T >
 Property container for object. More...
 
class  owl::TConstObjProperty< T >
 Read only Property container for object. More...
 
class  owl::TArrayProperty< T, I >
 
class  owl::TArrayProperty< T, I >::TSetter
 
class  owl::TConstArrayProperty< T, I >
 array read only array More...
 
class  owl::TConstArrayProperty< T, I >::TGetter
 
class  owl::TConstObjArrayProperty< T, I >
 array read only array More...
 
class  owl::TConstObjArrayProperty< T, I >::TGetter
 
class  owl::TFuncProperty< T >
 
class  owl::TFuncObjProperty< T >
 
class  owl::TFuncPropertyGet< T >
 
class  owl::TFuncObjPropertyGet< T >
 
class  owl::TFuncPropertyPut< T >
 
class  owl::TFuncObjPropertyPut< T >
 
class  owl::TFuncPropertyVarPut< T >
 
class  owl::TFuncObjPropertyVarPut< T >
 
class  owl::TFuncPropertyIdxGet< T, index >
 
class  owl::TFuncObjPropertyIdxGet< T, index >
 
class  owl::TFuncPropertyIdxPut< T, index >
 
class  owl::TFuncObjPropertyIdxPut< T, index >
 
class  owl::TFuncPropertyIdx< T, index >
 
class  owl::TFuncObjPropertyIdx< T, index >
 

Namespaces

namespace  owl
 Object Windows Library (OWLNext Core)
 

Macros

#define GETFUNCTOR(T, func)    Functor((TFunctor0<T>*)nullptr, func)
 
#define PUTFUNCTOR(T, func)    Functor((TFunctorV1<T>*)nullptr, func)
 
#define GETPUTFUNCTOR(T, funcGet, funcPut)
 
#define GETOBJFUNCTOR(T, func)    Functor((TFunctor0<T&>*)nullptr, func)
 
#define PUTOBJFUNCTOR(T, func)    Functor((TFunctorV1<const T&>*)nullptr, func)
 
#define GETPUTOBJFUNCTOR(T, funcGet, funcPut)
 
#define GETMFUNCTOR(T, type, memberFunc)    Functor((TFunctor0<T>*)nullptr, *this, &type::memberFunc)
 
#define PUTMFUNCTOR(T, type, memberFunc)    Functor((TFunctorV1<T>*)nullptr, *this, &type::memberFunc)
 
#define GETPUTMFUNCTOR(T, type, memberGet, memberPut)
 
#define GETOBJMFUNCTOR(T, type, memberFunc)    Functor((TFunctor0<T&>*)nullptr, *this, &type::memberFunc)
 
#define PUTOBJMFUNCTOR(T, type, memberFunc)    Functor((TFunctorV1<const T&>*)nullptr, *this, &type::memberFunc)
 
#define GETPUTOBJMFUNCTOR(T, type, memberGet, memberPut)
 
#define IDXGETFUNCTOR(T, func)    Functor((TFunctor1<T,int>*)nullptr, func)
 
#define IDXPUTFUNCTOR(T, func)    Functor((TFunctorV2<int,T>*)nullptr, func)
 
#define IDXGETPUTFUNCTOR(T, funcGet, funcPut)
 
#define IDXGETPUTOBJFUNCTOR(T, funcGet, funcPut)
 
#define IDXGETMFUNCTOR(T, type, memberFunc)    Functor((TFunctor1<T,int>*)nullptr, *this, &type::memberFunc)
 
#define IDXPUTMFUNCTOR(T, type, memberFunc)    Functor((TFunctorV2<int,T>*)nullptr, *this, &type::memberFunc)
 
#define IDXGETPUTMFUNCTOR(T, type, memberGet, memberPut)
 
#define IDXGETPUTOBJMFUNCTOR(T, type, memberGet, memberPut)
 

Detailed Description

Credits: The Property pattern is taken from "Patterns in Practice: A Property Template for C++", from "C++ Report", Nov/Dec 1995, p.

28-33, by Colin Hastie. I've in turn extended it to allow for "true" Delphi-like property syntax by allowing you to assign normal T objects to the TProperty<T>, as well as provide an implict conversion-to-T operator. Note that this implicit conversion is NOT highly held in regard by many C++-ers, and therefore can be #defined out of existence by #define-ing STRICT_PROPERTY_SYNTAX before #include-ing this file. Delphi (and C++Builder) also allow for methods to be used instead of direct access to data members; this, too, is allowed, by making use of the callback mechanism within VDBT/BDTF.H. TProperty<T> can be constructed to take two callbacks, one returning T taking void (get), and the other returning void and taking a const T& (set). These methods will be called in place of accessing the m_content method of Property<>, below. Note that I'm assuming that if you write the 'get', you'll also write the 'set', and that both methods provide their own storage for T (instead of relying on m_content within the TProperty<T>).

Requirements; TProperty assumes that the type T has meaningful orthodox canonical form semantics (default ctor, copy ctor, assignment op, dtor)

Definition in file property.h.