VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
objectConsole.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
13 
16 #include <vrfutil/vrfPrint.h>
17 
18 #include <vlutil/vlFilename.h>
19 #include <vlutil/vlPrint.h>
20 
21 #include <tbb/spin_mutex.h>
22 
23 #include <string>
24 #include <list>
25 
26 class DtOutputStream;
27 class DtOutputStreamBuffer;
28 class DtPrinter;
29 class DtSimObject;
30 
31 DT_DLL_vrfobjcore std::string moduleFromFilename( const std::string& file );
32 
34 #ifndef trUtf8
35 #define trUtf8( _message, _module ) DtTranslatableStream( _message, _module )
36 #else
37 #error "trutf8 already defined!"
38 #endif
39 
50 {
51 public:
52 
53  DtObjectConsole( const DtSimObject* );
54  virtual ~DtObjectConsole();
55 
58  virtual bool init();
59 
61  virtual void setNotifyLevel( DtNotifyLevelType level );
62  virtual void setNotifyLevel( const DtString& channel, DtNotifyLevelType level );
64  virtual DtNotifyLevelType notifyLevel() const;
65 
70  virtual void printToFile( const DtFilename& filename ) const;
72  virtual void stopPrintingToFile() const;
73 
76  virtual DtOutputStream& debugStream( const DtString& channel = "" ) const;
77  virtual DtOutputStream& verboseStream( const DtString& channel = "" ) const;
78  virtual DtOutputStream& infoStream( const DtString& channel = "" ) const;
79  virtual DtOutputStream& warnStream( const DtString& channel = "" ) const;
80  virtual DtOutputStream& errorStream( const DtString& channel = "" ) const;
82 
85  virtual void addConsolePrinter( DtPrinter* printer );
86 
93  virtual void addAndManageConsolePrinter( DtPrinter* printer );
94 
97  virtual void removeConsolePrinter( DtPrinter* printer );
98 
99  virtual const DtOutputChannelManager& channelManager() const;
100 
101 protected:
102 
105  virtual void addDefaultPrinters();
106 
107 private:
108 
111 
112  DtObjectConsole( const DtObjectConsole& orig );
113  DtObjectConsole& operator = ( const DtObjectConsole& orig );
114 
116 
117 protected:
118 
121 
123  mutable DtFilePrinter* myFilePrinter;
124 
126  mutable tbb::spin_mutex myMutex;
127 
129 
130 };
int myObjectConsoleThreshold
The current notification level for this object.
Definition: objectConsole.h:120
DtOutputChannelManager myChannelManager
Definition: objectConsole.h:125
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
Contains the DtTranslatableOutputStream class declaration.
The DtOutputChannelManager class manages default streams and channel-specific streams by notify level...
Definition: outputChannelManager.h:23
tbb::spin_mutex myMutex
Definition: objectConsole.h:126
This class represents the console for an individual object. It owns a set of streams for various noti...
Definition: objectConsole.h:49
DtFilePrinter * myFilePrinter
If file logging has been turned on, this holds the pointer to the current file printer.
Definition: objectConsole.h:123
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
const DtSimObject * mySimObject
Definition: objectConsole.h:128
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DT_DLL_vrfobjcore std::string moduleFromFilename(const std::string &file)
Contains the DtOutputChannelManager class declaration.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)