How to pass a Function pointer without exposing class details
<p>I'm creating a library that needs to allow the user to set a callback function. 
The interface of this library is as below:</p>

<pre><code>// Viewer Class Interface Exposed to user
/////////////////////////////
#include "dataType_1.h"
#include "dataType_2.h"

class Viewer
{
    void SetCallbackFuntion( dataType_1* (Func) (dataType_2* ) );
  private:
    dataType_1* (*CallbackFunction) (dataType_2* );
}
</code></pre>

<p>In a typical usage, the user needs to access an object of dataType_3 within the callback. 
However, this object is only known only to his program, like below.</p>

<pre><code>// User usage
#include "Viewer.h"
#include "dataType_3.h"

// Global Declaration needed
dataType_3* objectDataType3;

dataType_1* aFunction( dataType_2* a)
{
    // An operation on object of type dataType_3
    objectDataType3-&gt;DoSomething();
}

main()
{
    Viewer* myViewer;
    myViewer-&gt;SetCallbackFunction( &amp;aFunction ); 
}
</code></pre>

<p>My Question is as follows:
How do I avoid using an ugly global variable for <em>objectDataType3</em> ?
(objectDataType3 is part of libraryFoo and all the other objects dataType_1, dataType_2 &amp; Viewer are part of libraryFooBar) Hence I would like them to remain as separate as possible.</p>
