Leaked source code of windows server 2003
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.

142 lines
3.6 KiB

  1. // Results of the analysis phase
  2. // Copyright (c) 2001 Microsoft Corporation
  3. // Jun 2001 lucios
  4. #ifndef ANALYSIS_RESULTS_HPP
  5. #define ANALYSIS_RESULTS_HPP
  6. #include "global.hpp"
  7. #include "constants.hpp"
  8. using namespace std;
  9. // This file contains the data structure with the analysis results
  10. struct ObjectId
  11. {
  12. long locale;
  13. String object;
  14. ObjectId(long locale_,String &object_):
  15. locale(locale_),object(object_) {};
  16. // The operator below is necessary for structs
  17. // to be map keys. It ends up defining the order
  18. // in which the ldiff entries will appear, i.e.
  19. // first by locale and then by object.
  20. bool operator < (const ObjectId& idArg) const
  21. {
  22. return (locale < idArg.locale) ||
  23. (
  24. (locale == idArg.locale) &&
  25. (object < idArg.object)
  26. );
  27. }
  28. bool operator == (const ObjectId& idArg) const
  29. {
  30. return ( locale == idArg.locale ) &&
  31. ( object.icompare(idArg.object) == 0 );
  32. }
  33. };
  34. struct ValueActions
  35. {
  36. StringList addValues;
  37. StringList delValues;
  38. };
  39. typedef map <
  40. String,
  41. ValueActions,
  42. less<String>,
  43. Burnslib::Heap::Allocator<ValueActions>
  44. > PropertyActions;
  45. typedef map <
  46. ObjectId,
  47. PropertyActions,
  48. less<ObjectId>,
  49. Burnslib::Heap::Allocator<PropertyActions>
  50. > ObjectActions;
  51. // The previous map was thought keeping in mind the repair phase.
  52. // It accumulates additions and removals for properties
  53. // in order to provide an ldiff layout where all actions
  54. // related to a property would be grouped under all
  55. // actions related to an object
  56. //
  57. // The repair phase will do something like
  58. // For each element of objectActions
  59. // write the header for the object
  60. // like "dn: CN=object,CN=401,CN=DisplaySpecifiers...\n"
  61. // write "changetype: ntdsSchemaModify\n"
  62. // For each Property in the object
  63. // get the list of actions for the property
  64. // if you have a reset, write "delete: property\n-"
  65. // if you have additions
  66. // write "add: property\n"
  67. // write all additions in the form "property: addValue\n"
  68. // write "\n-\n"
  69. // End if
  70. // if you have removals
  71. // write "delete: property\n"
  72. // write all removals in the form "property: delValue\n"
  73. // write "\n-\n"
  74. // End if
  75. // End For Each
  76. // End For Each
  77. typedef list <
  78. ObjectId,
  79. Burnslib::Heap::Allocator<ObjectId>
  80. > ObjectIdList;
  81. struct SingleValue
  82. {
  83. long locale;
  84. String object;
  85. String property;
  86. String value;
  87. SingleValue
  88. (
  89. const long locale_,
  90. const String &object_,
  91. const String &property_,
  92. const String &value_
  93. )
  94. :
  95. locale(locale_),
  96. object(object_),
  97. property(property_),
  98. value(value_)
  99. {}
  100. };
  101. typedef list <
  102. SingleValue,
  103. Burnslib::Heap::Allocator<SingleValue>
  104. > SingleValueList;
  105. struct AnalysisResults
  106. {
  107. LongList createContainers;
  108. ObjectIdList conflictingWhistlerObjects;
  109. ObjectIdList createWhistlerObjects;
  110. ObjectIdList createW2KObjects;
  111. ObjectActions objectActions;
  112. SingleValueList customizedValues;
  113. ObjectActions extraneousValues;
  114. };
  115. #endif