Static Member variable: pointer to static member function of another class

I have two classes that I want to be able to communicate. Rather than using friend methods, I want to keep a static member variable, which is a pointer to static member function of the other class I want to call.

I simply can't figure out the syntax. It's mindboggling.

Here is the relevant code:

"hidentification.h":
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
#ifndef TYPENAMES_JAMES
#define TYPENAMES_JAMES

/*...more code here...*/

#include "hnode.h"
template <class T>
class hIdentification
{

	/*...more code here...*/

	private:
	//Member
	T data_	
	static hNode *(*_getNodeFunction)(const unsigned int&);//SYNTAX?
};
hNode (*_hNodeGetNodeFunction)(const unsigned int&) hIdentification<T>::_getNodeFunction = &hNode::getNode;//SYNTAX?
#include "hidentification.cxx"
#endif 


and "hnode.h":
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef HNODE_JAMES
#define HNODE_JAMES

/*...more code here...*/

class hNode
{
	public:

	/*...more code here...*/

	static const hNode* getNode(const unsigned int& dataID_);

//...more code here... 


The lines in "hidentification.h" commented with "//SYNTAX?" are giving me syntax errors when i try to compile. I've look up other places on the web and I can't seem to find syntax that will compile.

Any ideas? Thanks in advance.
Last edited on
Topic archived. No new replies allowed.