configVariableInt.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Filename: configVariableInt.h
  2. // Created by: drose (20Oct04)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CONFIGVARIABLEINT_H
  15. #define CONFIGVARIABLEINT_H
  16. #include "dtoolbase.h"
  17. #include "configVariable.h"
  18. ////////////////////////////////////////////////////////////////////
  19. // Class : ConfigVariableInt
  20. // Description : This is a convenience class to specialize
  21. // ConfigVariable as an integer type.
  22. ////////////////////////////////////////////////////////////////////
  23. class EXPCL_DTOOLCONFIG ConfigVariableInt : public ConfigVariable {
  24. PUBLISHED:
  25. INLINE ConfigVariableInt(const string &name);
  26. INLINE ConfigVariableInt(const string &name, int default_value,
  27. const string &description = string(),
  28. int flags = 0);
  29. INLINE ConfigVariableInt(const string &name, const string &default_value,
  30. const string &description = string(),
  31. int flags = 0);
  32. INLINE void operator = (int value);
  33. INLINE operator int () const;
  34. INLINE int size() const;
  35. INLINE int operator [] (int n) const;
  36. INLINE void set_value(int value);
  37. INLINE int get_value() const;
  38. INLINE int get_default_value() const;
  39. INLINE int get_word(int n) const;
  40. INLINE void set_word(int n, int value);
  41. private:
  42. void set_default_value(int default_value);
  43. private:
  44. AtomicAdjust::Integer _local_modified;
  45. int _cache;
  46. };
  47. #include "configVariableInt.I"
  48. #endif