VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
threadsafeOutputStream.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 
19 {
20 public:
21 
22  static DtChannelSpecificOutputStream* creator( DtOutputStreamBuffer* b, int& globalThresholdRef,
23  int threshold = 1, DtPrinter* dflt_printer = 0, const std::string& prefix = "" );
24 
25  DtThreadsafeOutputStream( DtOutputStreamBuffer* b, int& globalThresholdRef, int threshold = 1,
26  DtPrinter* dflt_printer = 0, const std::string& prefix = "" );
27 
28  virtual void write( const std::string &str ) override;
29 
30 private:
31 
33  DtThreadsafeOutputStream( const DtOutputStream & );
34 
36  DtThreadsafeOutputStream & operator = ( const DtOutputStream & );
37 
38 };
Writing to multiple output streams at a time can cause threading issues - specifically, a problem was found with sending multiple messages simultaneously during preprocess. This class prevents that by requiring a lock on write.
Definition: threadsafeOutputStream.h:18
Contains the DtTranslatableOutputStream class declaration.
Definition: outputChannelManager.h:161
virtual void write(const std::string &str)
Definition: outputChannelManager.h:179
static DtChannelSpecificOutputStream * creator(DtOutputStreamBuffer *b, int &globalThresholdRef, int threshold=1, DtPrinter *default_printer=0, const std::string &prefix="")
Static creation method.
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
Definition: translatableOutputStream.h:16

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)