Class declaration

F

Fab

Dear All

I am trying to understand a part of code in a Paraview plugin from an
OpenFOAM code, an open source CFD code. There is a part of a class
declaration in a header file I don't understand, here's the specific
code of it

/*---------------------------------------------------------------------------*\
Class vtkPV3blockMeshReader Declaration
\*---------------------------------------------------------------------------*/

class VTK_IO_EXPORT vtkPV3blockMeshReader
:
public vtkMultiBlockDataSetAlgorithm
{
public:
vtkTypeMacro(vtkPV3blockMeshReader, vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream&, vtkIndent);

(code continues here)


The declared class is vtkPV3blockMeshReader, why or what is the
VTK_IO_EXPORT preceding the class name? I could not find any example of
this kind elsewhere. Can someone elaborate on this for me?

Thanks + regards
Fab
 
J

Jorgen Grahn

Dear All

I am trying to understand a part of code in a Paraview plugin from an
OpenFOAM code, an open source CFD code. There is a part of a class
declaration in a header file I don't understand, here's the specific
code of it
....
class VTK_IO_EXPORT vtkPV3blockMeshReader ....

The declared class is vtkPV3blockMeshReader, why or what is the
VTK_IO_EXPORT preceding the class name? I could not find any example of
this kind elsewhere. Can someone elaborate on this for me?

Like the name suggests, it's something specific to that library you're
using, and probably to the compiler you use too. It's not standard
C++; it's a macro which expands into something, for some reason.

Google seems to give 16,400 hits for VTK_IO_EXPORT ... have you tried
that?

/Jorgen
 
Ö

Öö Tiib

class VTK_IO_EXPORT vtkPV3blockMeshReader
:
public vtkMultiBlockDataSetAlgorithm
{
(code continues here)


The declared class is vtkPV3blockMeshReader, why or what is the
VTK_IO_EXPORT preceding the class name? I could not find any example of
this kind elsewhere. Can someone elaborate on this for me?

This is likely a macro (defined elsewhere in the code of that library) to
achieve that dynamic linkage extensions to the language (that are present
in several implementations) work.

Standard C++ does not have modules, so it does not have dynamically
loadable modules and so does not have symbols (classes, variables,
functions) with dynamic linkage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top