IPConfig.cs 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. namespace TEAMModelOS.SDK
  3. {
  4. public class DbMakerConfigException : Exception
  5. {
  6. public string ErrMsg { get; private set; }
  7. public DbMakerConfigException(string errMsg)
  8. {
  9. ErrMsg = errMsg;
  10. }
  11. }
  12. public class IPConfig
  13. {
  14. public int TotalHeaderSize
  15. {
  16. get;
  17. private set;
  18. }
  19. public int indexBlockSize
  20. {
  21. get;
  22. private set;
  23. }
  24. public IPConfig(int totalHeaderSize)
  25. {
  26. if ((totalHeaderSize % 8) != 0)
  27. {
  28. throw new DbMakerConfigException("totalHeaderSize must be times of 8");
  29. }
  30. TotalHeaderSize = totalHeaderSize;
  31. //4 * 2048
  32. indexBlockSize = 8192;
  33. }
  34. public IPConfig():this(8 * 2048)
  35. {
  36. }
  37. }
  38. }