You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Visitor.h 1.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
  2. /******************************************************************************
  3. *
  4. * file: Visitor.h
  5. *
  6. * Copyright (c) 2003, Michael E. Smoot .
  7. * Copyright (c) 2017, Google LLC
  8. * All rights reserved.
  9. *
  10. * See the file COPYING in the top directory of this distribution for
  11. * more information.
  12. *
  13. * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  16. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19. * DEALINGS IN THE SOFTWARE.
  20. *
  21. *****************************************************************************/
  22. #ifndef TCLAP_VISITOR_H
  23. #define TCLAP_VISITOR_H
  24. namespace TCLAP
  25. {
  26. /**
  27. * A base class that defines the interface for visitors.
  28. */
  29. class Visitor
  30. {
  31. public:
  32. /**
  33. * Constructor. Does nothing.
  34. */
  35. Visitor()
  36. {
  37. }
  38. /**
  39. * Destructor. Does nothing.
  40. */
  41. virtual ~Visitor()
  42. {
  43. }
  44. /**
  45. * This method (to implemented by children) will be
  46. * called when the visitor is visited.
  47. */
  48. virtual void visit() = 0;
  49. };
  50. } // namespace TCLAP
  51. #endif