VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cmdVersionVisitor.h
Go to the documentation of this file.
1 
2 /******************************************************************************
3  *
4  * file: VersionVisitor.h
5  *
6  * Copyright (c) 2003, Michael E. Smoot .
7  * All rights reverved.
8  *
9  * See the file COPYING in the top directory of this distribution for
10  * more information.
11  *
12  * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
13  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18  * DEALINGS IN THE SOFTWARE.
19  *
20  *****************************************************************************/
21 
22 
23 #ifndef DtCmdLine_VERSION_VISITOR_H
24 #define DtCmdLine_VERSION_VISITOR_H
25 
29 
30 #include "cmdLineInterface.h"
31 #include "cmdLineOutput.h"
32 #include "cmdVisitor.h"
33 
34 #include <vlutil/vlPrint.h>
35 #include <vlutil/vlKeyboard.h>
37 
38 #ifdef DtUSE_UTILITIES_NAMESPACE
39 namespace DtUSE_UTILITIES_NAMESPACE
40 {
41 #endif
42 
43  namespace DtCmdLine {
44 
49 
50  class VersionVisitor: public Visitor
51  {
52  protected:
53 
58 
63 
65 
66  public:
67 
74 #ifdef _WIN32
75  bool pressAnyKey = true )
76 #else
77  bool pressAnyKey = false )
78 #endif
79  : Visitor(), _cmd( cmd ), _out( out ), myPressAnyKey(pressAnyKey) { }
80 
85  virtual ~VersionVisitor() { }
86  void visit();
87 
88  };
89 
90  inline void VersionVisitor::visit()
91  {
92  (*_out)->version(*_cmd);
93 
94  int oldNotifyLevel = DtNotifyLevel;
95  DtNotifyLevel = 3;
96 
97  if (myPressAnyKey)
98  {
99  DtInfo << "Press any key to continue" << std::endl;
100 
101  while (DtPollBlockingInputChar() == '\0')
102  {
103  DtSleep(0.1);
104  }
105  }
106 
107  DtNotifyLevel = oldNotifyLevel;
108 
109  exit(0);
110  }
111 
112  }
113 
114 #ifdef DtUSE_UTILITIES_NAMESPACE
115 }
116 #endif
117 
118 #endif

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)