17 #ifndef AGX_LOGSTREAM_H 18 #define AGX_LOGSTREAM_H 21 # pragma warning(push) 22 # pragma warning(disable: 4355) // No warnings about using this in member initializer list 23 # pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y 53 typedef void ( *CallbackFunction_t )(
const char*,
unsigned int );
67 void setDateFormat(
const agx::String& date_format );
70 void setEnableDate(
bool flag );
72 bool getEnableDate()
const;
77 void setEnableThreadId(
bool flag);
79 bool getEnableThreadId()
const;
85 enum OutputMode { CERR = 1, COUT = 2, FILE = 4, FUNCTION = 8 };
88 void appendOutputMode(
short modemask );
91 void setOutputMode(
short modemask );
94 void clearOutputMode(
void );
97 int getOutputMode(
void );
108 bool haveOpenFile()
const;
121 void setCallback( CallbackFunction_t f );
125 CallbackFunction_t getCallback();
131 virtual void message(
const char* msg,
unsigned int length );
135 size_t write(
const char *msg, std::streamsize count);
154 bool m_threadId_enabled;
159 template < class logStreamT, class charT, class traits =
std::char_traits<charT> >
164 LogBuf( logStreamT* stream ) : m_stream( stream ) {}
169 typedef LogBuf<logStreamT, charT> classT;
170 typedef std::basic_streambuf<charT, traits> BaseClassT;
172 std::streamsize output(
const char* pStr, std::streamsize n );
174 int overflow (
int ch );
178 LogBuf(
const LogBuf& );
179 LogBuf& operator=(
const LogBuf& );
180 logStreamT* m_stream;
181 std::ostringstream m_strStream;
185 typedef LogBuf<LogStream, char> LogBufT;
188 template <
class logStreamT,
class charT,
class traits >
friend class LogBuf;
195 # pragma warning(pop) Class for printing out messages to console, file, virtual method and or a callback function...
OutputMode
Enums used to specify the output mode used. These can be OR:ed together.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
CallbackFunction_t m_callback
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()