what is the virtual properties

I'm c++ beginner and could not understand the following

1
2
3
4
5
6
7
8
9
    class CItem
    {
    public:
    	VIRTUALPROPERTY_BOTH(DWORD, UID, set_UID, get_UID)
    	VIRTUALPROPERTY_BOTH(OBJID, ID, set_ID, get_ID)
    	VIRTUALPROPERTY_BOTH(BYTE, Bless, set_Bless, get_Bless)
    	VIRTUALPROPERTY_BOTH(WORD, Reborn, set_Reborn, get_Reborn)
    	VIRTUALPROPERTY_GET(BYTE*, Sockets, get_Sockets); 
    };


and at another class

1
2
3
4
5
6
7
8
    #define VIRTUALPROPERTY_BOTH(type, name, setter, getter) \
    	virtual void setter ( type value ) = NULL; \
    	virtual type getter () = NULL; \
    	__declspec(property(put = setter, get = getter)) type name;
    
    #define VIRTUALPROPERTY_GET(type, name, getter) \
    	virtual type getter () = NULL; \
    	__declspec(property(get = getter)) type name; 


i know the __declspec(property(put = function, get = function)) type variable
but what is that called and what it does ? Sorry couldn't find any direct answer
Please and thanks

edit: also what about this

1
2
    #define PROPERTY_BOTH(type, name, setter, getter) __declspec(property(put = setter, get = getter)) type name;
    #define PROPERTY_GET(type, name, getter) __declspec(property(get = getter)) type name; 
Last edited on
Microsoft Specific
This attribute can be applied to non-static "virtual data members" in a class or structure definition. The compiler treats these "virtual data members" as data members by changing their references into function calls.

http://msdn.microsoft.com/en-US/library/yhfk0thd%28v=vs.80%29.aspx
Topic archived. No new replies allowed.