Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
3.7 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. resdict.hxx
  5. Abstract:
  6. resource dictionary class definitions.
  7. Notes:
  8. History:
  9. VibhasC Aug-08-1993 Created.
  10. ----------------------------------------------------------------------------*/
  11. #ifndef __RESDICT_HXX__
  12. #define __RESDICT_HXX__
  13. /****************************************************************************
  14. * include files
  15. ***************************************************************************/
  16. #include "nulldefs.h"
  17. extern "C"
  18. {
  19. #include <stdio.h>
  20. }
  21. #include "dict.hxx"
  22. #include "resdef.hxx"
  23. #include "listhndl.hxx"
  24. /****************************************************************************
  25. * externs
  26. ***************************************************************************/
  27. extern int CompareResourceKey( void *, void *);
  28. extern void PrintResourceKey( void * );
  29. class RESOURCE_DICT : public Dictionary
  30. {
  31. public:
  32. //
  33. // The resource dictionary constructor must be supplied with the
  34. // comparison and print routines.
  35. //
  36. RESOURCE_DICT() : Dictionary( )
  37. {
  38. }
  39. //
  40. // The resource dictionary must delete all the resources it allocated.
  41. //
  42. ~RESOURCE_DICT()
  43. {
  44. Clear();
  45. }
  46. //
  47. // Insert a resource of a given name into the dictionary.
  48. //
  49. RESOURCE * Insert( PNAME pResName, node_skl * pT );
  50. //
  51. // Search for a resource of a particular name in the dictionary.
  52. //
  53. RESOURCE * Search( PNAME pResName );
  54. //
  55. // Get a list of all resources.
  56. //
  57. short GetListOfResources( ITERATOR& ListIter );
  58. //
  59. // Clear up the dictionary by deleting all the resources allocated.
  60. //
  61. void Clear();
  62. //
  63. // Comparison function...
  64. //
  65. virtual
  66. SSIZE_T Compare (pUserType pL, pUserType pR);
  67. };
  68. //
  69. // This class is a data base of resource dictionaries.
  70. //
  71. class RESOURCE_DICT_DATABASE
  72. {
  73. private:
  74. //
  75. // The global resource dictionary. This refers to resources used by the
  76. // stub which are globally available. For example, these may include
  77. // global variables declared for implicit_handles.
  78. //
  79. RESOURCE_DICT GlobalResourceDict;
  80. //
  81. // Parameter resource dictionary. All parameters are treated as resources.
  82. // They may or may not be used as local variables by the stub during
  83. // marshalling or unmarshalling.
  84. //
  85. RESOURCE_DICT ParamResourceDict;
  86. //
  87. // Local variable resource dictionary. These refer to local variables
  88. // the stub declares for its own use. For example, on the client side,
  89. // the stub message and the rpc message are treated as local variables.
  90. // On the server side, the stub may declare local variables corresponding
  91. // to the parameters in the procedure signature.
  92. //
  93. RESOURCE_DICT LocalResourceDict;
  94. //
  95. // Transient resource dictionary. This dictionary is to keep track of
  96. // the local variables declared for special data structures (like arrays)
  97. // which have even more locality than the local variables declared at the
  98. // stub prolog level.
  99. //
  100. RESOURCE_DICT TransientResourceDict;
  101. public:
  102. //
  103. // The constructor. The embedded resource dictionaries will be automatically
  104. // inited.
  105. //
  106. RESOURCE_DICT_DATABASE()
  107. {
  108. }
  109. //
  110. // Get methods.
  111. //
  112. RESOURCE_DICT * GetGlobalResourceDict()
  113. {
  114. return &GlobalResourceDict;
  115. }
  116. RESOURCE_DICT * GetParamResourceDict()
  117. {
  118. return &ParamResourceDict;
  119. }
  120. RESOURCE_DICT * GetLocalResourceDict()
  121. {
  122. return &LocalResourceDict;
  123. }
  124. RESOURCE_DICT * GetTransientResourceDict()
  125. {
  126. return &TransientResourceDict;
  127. }
  128. void ClearTransientResourceDict()
  129. {
  130. TransientResourceDict.Clear();
  131. }
  132. };
  133. #endif // __RESDICT_HXX__