AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
ScriptConsole.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17
18#pragma once
19#ifndef AGXPYTHON_SCRIPTCONSOLE_H
20#define AGXPYTHON_SCRIPTCONSOLE_H 1
21
22#include <agx/config/AGX_USE_PYTHON.h>
23
24#if AGX_USE_PYTHON()
25
26#include <agxPython/export.h>
27
28#include <agx/Referenced.h>
29#include <agx/String.h>
30
31#include <string>
32
33namespace agxPython
34{
35
36 class AGXPYTHON_EXPORT ScriptConsole : public agx::Referenced
37 {
38 public:
39
46 static bool EmbedIntoPython();
47
48 ScriptConsole();
49
55 virtual void OnStdout(const agx::String& buffer);
56
62 virtual void OnStderr(const agx::String& buffer);
63
64 void write(const std::string& s, void *type);
65
66 void init();
67
68 void set_stdout();
69 void reset_stdout();
70
71 void set_stderr();
72 void reset_stderr();
73
74 protected:
75
76 virtual ~ScriptConsole();
77
78 private:
79
80 void *m_stdout;
81 void *m_stdout_saved;
82
83 void *m_stderr;
84 void *m_stderr_saved;
85
86 };
87
88
89}
90
91
92
93#endif
94
95#endif
#define AGXPYTHON_EXPORT
Base class providing referencing counted objects.
Definition Referenced.h:120