X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Interface.h;h=0e79a10f6c124f27db5cac305f21e49a3b8f6dbb;hb=7f873aed4bae5a98dca078209699b54276b46fce;hp=1a605595bf5445069eb36a7c5a25e089337ea1b3;hpb=de0f49686ec6655ddc5816c8fa5383964662aec4;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Interface.h b/src/GeomAPI/GeomAPI_Interface.h index 1a605595b..0e79a10f6 100644 --- a/src/GeomAPI/GeomAPI_Interface.h +++ b/src/GeomAPI/GeomAPI_Interface.h @@ -1,9 +1,11 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAPI_Interface.hxx // Created: 23 Apr 2014 // Author: Mikhail PONIKAROV -#ifndef GeomAPI_Interface_HeaderFile -#define GeomAPI_Interface_HeaderFile +#ifndef GeomAPI_Interface_H_ +#define GeomAPI_Interface_H_ #include @@ -14,24 +16,31 @@ class GEOMAPI_EXPORT GeomAPI_Interface { -protected: - void* myImpl; ///< pointer to the internal implementation object + protected: + void* myImpl; ///< pointer to the internal impl object -public: + public: /// None - constructor GeomAPI_Interface(); - /// Constructor by the implementation pointer (used for internal needs) + /// Constructor by the impl pointer (used for internal needs) GeomAPI_Interface(void* theImpl); - + /// Destructor virtual ~GeomAPI_Interface(); - /// Returns the pointer to the implementation - void* implementation(); - /// Updates the implementation (deletes the old one) - void setImplementation(void* theImpl); + /// Returns the pointer to the impl + template inline T* implPtr() + { + return static_cast(myImpl); + } + /// Returns the reference object of the impl + template inline const T& impl() + { + return *(static_cast(myImpl)); + } + /// Updates the impl (deletes the old one) + void setImpl(void* theImpl); }; #endif -