Skip to content
Snippets Groups Projects
Commit e2ba9648 authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Fix friend classes declaration.

In C++ >= 11, the friend class declaration when the friend class is typedef-ed
must use a simple-type-specifier instead of an elaborated-type-specifier.

Ref: https://community.ibm.com/community/user/ibmz-and-linuxone/blogs/fang-lu2/2020/03/24/introduction-to-the-c11-feature-extended-friend-declaration?
parent 8c767d89
No related branches found
No related tags found
1 merge request!9Fix friend classes persistification and concurrent access to add() method
Pipeline #1613573 passed
......@@ -9,12 +9,12 @@ set( CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build mode to use" )
set( CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard used for the build" )
set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "(Dis)allow using GNU extensions" )
# Print Build Info on screen
include(cmake/PrintBuildInfo.cmake)
# Make the module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
# Print Build Info on screen
include( PrintBuildInfo )
# Set up how the project would use Eigen.
include( SetupEigen3 )
......
......@@ -9,7 +9,7 @@
#ifndef _GeoShapePersistification_On_
class Persistifier;
class Persistifier;
#endif
......@@ -21,50 +21,50 @@ class GeoShapeIntersection : public GeoShape
// Constructor taking two shape operands.
GeoShapeIntersection (const GeoShape* A, const GeoShape* B);
// Returns the volume of the shape, for mass inventory
virtual double volume () const;
// Returns the AND shape type, as a string.
virtual const std::string & type () const;
// Returns the AND shape type, as a coded integer.
virtual ShapeType typeID () const;
// Returns the first operand being ANDed
const GeoShape* getOpA () const;
// Returns the second operand being ANDed.
const GeoShape* getOpB () const;
// Executes a GeoShapeAction
virtual void exec (GeoShapeAction *action) const;
// For type identification.
static const std::string& getClassType ();
// For type identification.
static ShapeType getClassTypeID ();
protected:
virtual ~GeoShapeIntersection();
private:
GeoShapeIntersection(const GeoShapeIntersection &right);
GeoShapeIntersection & operator=(const GeoShapeIntersection &right);
// The first shape operand in the AND operation.
const GeoShape* m_opA;
// The second shape operand in the AND operation.
const GeoShape* m_opB;
static const std::string s_classType;
static const ShapeType s_classTypeID;
// For I/O only!
GeoShapeIntersection(){}
friend class Persistifier;
friend Persistifier;
};
inline const std::string& GeoShapeIntersection::getClassType ()
......
......@@ -10,7 +10,7 @@
#ifndef _GeoShapePersistification_On_
class Persistifier;
class Persistifier;
#endif
......@@ -18,50 +18,50 @@ class GeoShapeShift : public GeoShape
{
public:
GeoShapeShift (const GeoShape* A, const GeoTrf::Transform3D &X);
// Returns the volume of the shape, for mass inventory
virtual double volume () const;
// Returns the OR shape type, as a string.
virtual const std::string & type () const;
// Returns the OR shape type, as a coded integer.
virtual ShapeType typeID () const;
// Returns the first operand being ORed
const GeoShape* getOp () const;
// Returns the shift of this shape.
const GeoTrf::Transform3D & getX () const;
// Executes a GeoShapeAction
virtual void exec (GeoShapeAction *action) const;
// For type identification.
static const std::string& getClassType ();
// For type identification.
static ShapeType getClassTypeID ();
protected:
virtual ~GeoShapeShift();
private:
GeoShapeShift(const GeoShapeShift &right);
GeoShapeShift & operator=(const GeoShapeShift &right);
// The shape operand in the NOT operation.
const GeoShape* m_op;
// Gives the amount by which the volume is shifted.
GeoTrf::Transform3D m_shift;
static const std::string s_classType;
static const ShapeType s_classTypeID;
// For I/O only!
GeoShapeShift(){}
friend class Persistifier;
friend Persistifier;
};
......
......@@ -9,7 +9,7 @@
#ifndef _GeoShapePersistification_On_
class Persistifier;
class Persistifier;
#endif
......@@ -17,38 +17,38 @@ class GeoShapeSubtraction : public GeoShape
{
public:
GeoShapeSubtraction (const GeoShape* A, const GeoShape* B);
// Returns the volume of the shape, for mass inventory
virtual double volume () const;
// Returns the NOT shape type, as a string.
virtual const std::string & type () const;
// Returns the NOT shape type, as a coded integer.
virtual ShapeType typeID () const;
// Returns the first operand in the subtraction
const GeoShape* getOpA () const;
// Returns the second operand in the subtraction
const GeoShape* getOpB () const;
// Executes a GeoShapeAction
virtual void exec (GeoShapeAction *action) const;
// For type identification.
static const std::string& getClassType ();
// For type identification.
static ShapeType getClassTypeID ();
protected:
virtual ~GeoShapeSubtraction();
private:
GeoShapeSubtraction(const GeoShapeSubtraction &right);
GeoShapeSubtraction & operator=(const GeoShapeSubtraction &right);
// The shape operand in the Subtraction operation
const GeoShape* m_opA;
......@@ -60,8 +60,8 @@ class GeoShapeSubtraction : public GeoShape
// For I/O only!
GeoShapeSubtraction(){}
friend class Persistifier;
friend Persistifier;
};
inline const std::string& GeoShapeSubtraction::getClassType ()
......
......@@ -8,7 +8,7 @@
#include "GeoModelKernel/GeoShape.h"
#ifndef _GeoShapePersistification_On_
class Persistifier;
class Persistifier;
#endif
class GeoShapeUnion : public GeoShape
......@@ -18,35 +18,35 @@ class GeoShapeUnion : public GeoShape
// Returns the volume of the shape, for mass inventory
virtual double volume () const;
// Returns the OR shape type, as a string.
virtual const std::string & type () const;
// Returns the OR shape type, as a coded integer.
virtual ShapeType typeID () const;
// Returns the first operand being ORed
const GeoShape* getOpA () const;
// Returns the second operand being ORed.
const GeoShape* getOpB () const;
// Executes a GeoShapeAction
virtual void exec (GeoShapeAction *action) const;
// For type identification.
static const std::string& getClassType ();
// For type identification.
static ShapeType getClassTypeID ();
protected:
virtual ~GeoShapeUnion();
private:
GeoShapeUnion(const GeoShapeUnion &right);
GeoShapeUnion & operator=(const GeoShapeUnion &right);
// The first shape operand in the OR operation.
const GeoShape* m_opA;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment