ADTF
d_ptr.h File Reference

Copyright © Audi Electronics Venture GmbH. More...

Go to the source code of this file.

Classes

class  d_ptr_impl< _PARENT, _PRIVATE_D >
 Template to implement the Private class of the global d_pointer definitions. More...
 
class  d_ptr< _PARENT, _PRIVATE_D >
 Template class for the d-pointer Reference class withing the Parent Class. More...
 

Namespaces

 A_UTILS_NS
 ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
 

Macros

#define A_UTILS_D_CLASS(__dclassname_, __pclassname_)
 Concrete d-pointer definition. More...
 
#define A_UTILS_D(__pclassname_)   A_UTILS_D_CLASS(__pclassname_ ## Private, __pclassname_)
 Helper macro for d-pattern definitions. More...
 
#define A_UTILS_D_CREATE_CLASS(__classname_)
 concrete d-pointer instance More...
 
#define A_UTILS_D_CREATE(__classname_)   A_UTILS_D_CREATE_CLASS(__classname_ ## Private)
 helper macro for d-pattern usage. More...
 
#define A_UTILS_DECLARE_LOCAL_D(__classname_)   __classname_ ## Private* _D = _d.Get_d()
 helper macro that defines a local variable "_D" that points to the private implementation. More...
 
#define A_UTILS_P_DECLARE_CLASS(__d_classname_, __p_classname_)   class __p_classname_::__d_classname_ : public A_UTILS_NS::d_ptr_impl<__p_classname_, __p_classname_::__d_classname_>
 Helper Macro to declare the class header. More...
 
#define A_UTILS_P_DECLARE(__p_classname_)   A_UTILS_P_DECLARE_CLASS(__p_classname_ ## Private, __p_classname_)
 Helper Macro to generate the private class name and to declare the class header. More...
 
#define A_UTILS_P_CLASS(__p_classname_)   __p_classname_::__p_classname_ ## Private
 Helper Macro to generate the private class name. More...
 
#define A_UTILS_P_DECLARE_CLASS_PRE(__d_classname_, __p_classname_)
 Helper Macro to declare the private class which has no implementation yet. More...
 
#define A_UTILS_P_DECLARE_PRE(__p_classname_)   A_UTILS_P_DECLARE_CLASS_PRE(__p_classname_ ## Private, __p_classname_)
 Helper Macro to declare the private class which has no implementation yet. More...
 

Functions

template<typename _PARENT , typename _PRIVATE_D >
tVoid swap (A_UTILS_NS::d_ptr< _PARENT, _PRIVATE_D > &i_oLHS, A_UTILS_NS::d_ptr< _PARENT, _PRIVATE_D > &i_oRHS)
 std::swap specialization for AUTILSDPtr for perfect fit on ADL More...
 

Detailed Description

Copyright © Audi Electronics Venture GmbH.

All rights reserved

Definition in file d_ptr.h.

Macro Definition Documentation

◆ A_UTILS_D

#define A_UTILS_D (   __pclassname_)    A_UTILS_D_CLASS(__pclassname_ ## Private, __pclassname_)

Helper macro for d-pattern definitions.

this macro should be used by developer It declares the the Private Class see A_UTILS_D_CLASS.

Parameters
[in]__pclassname_parent class name
See also
page_d_pointer

Definition at line 270 of file d_ptr.h.

◆ A_UTILS_D_CLASS

#define A_UTILS_D_CLASS (   __dclassname_,
  __pclassname_ 
)
Value:
private: \
class __dclassname_; \
A_UTILS_NS::d_ptr<__pclassname_, __dclassname_> _d; \
friend class __dclassname_;

Concrete d-pointer definition.

This d-Pointer definition is used to create a d-Pointer Reference to the Private implementation of the class. To do so it will use the d_ptr template.

Parameters
[in]__dclassname_d pointer class name.
[in]__pclassname_parent class name.
See also
d_ptr, page_d_pointer

Definition at line 256 of file d_ptr.h.

◆ A_UTILS_D_CREATE

#define A_UTILS_D_CREATE (   __classname_)    A_UTILS_D_CREATE_CLASS(__classname_ ## Private)

helper macro for d-pattern usage.

Parameters
[in]__classname_parent class name
See also
page_d_pointer

Definition at line 286 of file d_ptr.h.

◆ A_UTILS_D_CREATE_CLASS

#define A_UTILS_D_CREATE_CLASS (   __classname_)
Value:
_d = new __classname_(); \
_d->Set_p(this)

concrete d-pointer instance

Parameters
[in]__classname_parent class
See also
page_d_pointer

Definition at line 277 of file d_ptr.h.

◆ A_UTILS_DECLARE_LOCAL_D

#define A_UTILS_DECLARE_LOCAL_D (   __classname_)    __classname_ ## Private* _D = _d.Get_d()

helper macro that defines a local variable "_D" that points to the private implementation.

Parameters
[in]__classname_parent class name
See also
page_d_pointer

Definition at line 293 of file d_ptr.h.

◆ A_UTILS_P_CLASS

#define A_UTILS_P_CLASS (   __p_classname_)    __p_classname_::__p_classname_ ## Private

Helper Macro to generate the private class name.

Parameters
[in]__p_classname_The Parent Class

Definition at line 312 of file d_ptr.h.

◆ A_UTILS_P_DECLARE

#define A_UTILS_P_DECLARE (   __p_classname_)    A_UTILS_P_DECLARE_CLASS(__p_classname_ ## Private, __p_classname_)

Helper Macro to generate the private class name and to declare the class header.

Parameters
[in]__p_classname_The Parent Class

Definition at line 306 of file d_ptr.h.

◆ A_UTILS_P_DECLARE_CLASS

#define A_UTILS_P_DECLARE_CLASS (   __d_classname_,
  __p_classname_ 
)    class __p_classname_::__d_classname_ : public A_UTILS_NS::d_ptr_impl<__p_classname_, __p_classname_::__d_classname_>

Helper Macro to declare the class header.

Parameters
[in]__d_classname_The Private D Class
[in]__p_classname_The Parent Class

Definition at line 300 of file d_ptr.h.

◆ A_UTILS_P_DECLARE_CLASS_PRE

#define A_UTILS_P_DECLARE_CLASS_PRE (   __d_classname_,
  __p_classname_ 
)
Value:
A_UTILS_P_DECLARE_CLASS(__d_classname_, __p_classname_)\
{ \
friend class __p_classname_; \
public: \
__d_classname_(){}; \
virtual ~__d_classname_(){}; \
};
#define A_UTILS_P_DECLARE_CLASS(__d_classname_, __p_classname_)
Helper Macro to declare the class header.
Definition: d_ptr.h:300

Helper Macro to declare the private class which has no implementation yet.

Parameters
[in]__d_classname_The Private D Class
[in]__p_classname_The Parent Class

Definition at line 319 of file d_ptr.h.

◆ A_UTILS_P_DECLARE_PRE

#define A_UTILS_P_DECLARE_PRE (   __p_classname_)    A_UTILS_P_DECLARE_CLASS_PRE(__p_classname_ ## Private, __p_classname_)

Helper Macro to declare the private class which has no implementation yet.

It will generate the private classname.

Parameters
[in]__p_classname_The Parent Class

Definition at line 333 of file d_ptr.h.

Function Documentation

◆ swap()

tVoid std::swap ( A_UTILS_NS::d_ptr< _PARENT, _PRIVATE_D > &  i_oLHS,
A_UTILS_NS::d_ptr< _PARENT, _PRIVATE_D > &  i_oRHS 
)
inline

std::swap specialization for AUTILSDPtr for perfect fit on ADL

Template Parameters
_PARENTParent type for both d_ptr implementations
_PRIVATE_DPrivate type for both d_ptr implementations
Parameters
[in,out]i_oLHSLeft hand side swap object
[in,out]i_oRHSRight hand side swap object
Postcondition
i_oLHS and i_oRHS swapped contents.

Definition at line 237 of file d_ptr.h.

References std::swap(), and d_ptr< _PARENT, _PRIVATE_D >::Swap().

Referenced by ResultDescription< DescriptionIntf >::ResultDescription(), ResultDescription< DescriptionIntf >::operator=(), and std::swap().