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.

58 lines
1.1 KiB

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. /*---------------------------------------------------------
  13. Filename: opreg.cpp
  14. Written By: B.Rajeev
  15. ----------------------------------------------------------*/
  16. #include "precomp.h"
  17. #include <provexpt.h>
  18. #include "fs_reg.h"
  19. #include "pseudo.h"
  20. #include "ophelp.h"
  21. #include "opreg.h"
  22. #include "op.h"
  23. OperationRegistry::OperationRegistry()
  24. {
  25. num_registered = 0;
  26. }
  27. void OperationRegistry::Register(IN SnmpOperation &operation)
  28. {
  29. // flagging the operation as registered
  30. store[&operation] = NULL;
  31. num_registered++;
  32. }
  33. void OperationRegistry::Deregister(IN SnmpOperation &operation)
  34. {
  35. // flag the operation as unregistered
  36. if ( store.RemoveKey(&operation) )
  37. {
  38. num_registered--;
  39. }
  40. }
  41. OperationRegistry::~OperationRegistry()
  42. {
  43. store.RemoveAll();
  44. }