i'm a bit confused here, a pointer is something aiming to an object,
but a static class is not an object, nevertheless i would like to have
the possibility of doing something like handling an HashTable and
getting from it a pointer to a static class :
( (classStatic)myHash("classStatic") ).staticMethod()
...is this possible, or i'm i short on reading?
So you want to index different types in order to access one
identically named static method on one of them?
It's not as easy as storing multiple objects, but it's certainly
possible using a mechanism known as "reflection".
Variant 1. Store the class name (e.g. "classStatic") in your
hashtable, and then use reflection to get the TypeInfo object for the
class, then the MethodInfo object for your method, then invoke the
method. That works but it's cumbersome and slow to execute.
Variant 2. Same as 1, but when adding a new element to your hashtable
you immediately determine the TypeInfo and store that instead of the
class name. Even better, if you always call just one method you
determine its MethodInfo object and store that.
Variant 3. Same as 2, but you declare a delegate that matches your
staticMethod, and when adding a new hashtable element you store a
delegate object for the new type's method, not a MethodInfo object.
Variant 4. Same as 3, but you avoid reflection altogether by having
the static classes add themselves to the hashtable. They can
immediately create a delegate for one of their own methods, without
having to use reflection and run-time name lookups. Big disadvantage
here: each of the static classes must have an "adder" method, or else
some central "adder" method has to have all static classes hardcoded.