MFC课程CMAP

时间:2016-06-24 19:27:48

标签: class dictionary mfc

What I do not understand is the :  “UINT&”.  What does it mean in the context of the template

       static CMap<CString, LPCSTR, UINT, UINT&> cXMLfields::fields_by_name;


       static CMap<CString, LPCSTR, UINT, UINT&> cXMLfields::oopf_fields_by_name;
       static CString friendly_name[XML_FIELDNUM];
       static CString fields_by_id[XML_FIELDNUM];
       static CString oopf_fields_by_id[OOPF_XML_FIELDNUM];
       static void Build_map();
       static void MoveItem(CListBox& src, CListBox& dst, int index);


CMap<CString,LPCTSTR, struct_sample,struct_sample> myMap;
struct_sample aTest;
aTest.a = 1;
aTest.b = 2;
aTest.c = 3;
myMap.SetAt("test",aTest);
    struct_sample aLookupTest;
    BOOL bExists = myMap.Lookup("test",aLookupTest); //Retrieves the 
                             //struct_sample corresponding to "test".

我理解这个理论,但我的密钥是一个字符串,例如“RFIDTAG1”。我的值是无符号整数。 Example.UNIT是特定KEY的值...例如{Age:27}其中Age是Key而27是Value.I当值是一个整数时,我会理解这个值是否是一个结构。那么您可以使用{年龄:27}作为示例,并在使用结构时向我显示如下代码

1 个答案:

答案 0 :(得分:0)

&amp;表示通过引用传递

请参阅此link

此处还有MSDN

  

ARG_VALUE

     

用于VALUE参数的数据类型;通常是参考到VALUE。