HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_WriteCode.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CH_WriteCode.h ( CH Library, C++)
7  *
8  * COMMENTS:
9  * Writes the C++ code to implement a channel...
10  * This is designed to be overloaded where necessary to customize
11  * it for specific environments (such as inside a POP)
12  */
13 
14 #ifndef __CH_WriteCode__
15 #define __CH_WriteCode__
16 
17 #include "CH_API.h"
18 #include <SYS/SYS_Types.h>
19 #include <UT/UT_NonCopyable.h>
20 #include <iosfwd>
21 
23 {
24 public:
25  CH_WriteCode();
26  virtual ~CH_WriteCode();
27 
29 
30  // os is output stream to write the new function call. gs is
31  // the global stream to put the data.
32  // prefix is the file level prefix, a channel specific name
33  // will be appended.
34  // Force type is one of CH_ChannelBehavior. -1 doesn't cause
35  // any forcing to occur.
36  int writeCode(CH_Channel *chan, std::ostream &os,
37  std::ostream &gs,
38  const UT_String &prefix,
39  const UT_String &mainprefix, int isstatic = 1,
40  int forcetype = -1);
41 
42  // This function expands expressions:
43  virtual void expandExpression(UT_String &expr);
44 
45  // These mark the start and end of each call back functions expandExpression
46  // region. They both write BEFORE the result of expandExpression
47  // is written.
48  virtual void startExpressionBlock(std::ostream &gs);
49  virtual void stopExpressionBlock(std::ostream &gs);
50 
51  static void writeChannelType(std::ostream &os, CH_ChannelBehavior type);
52 
53  // Writes a proper C++ fpreal with the "F" qualifier.
54  static void writeFloat(std::ostream &os, fpreal val);
55 
56 protected:
57  // Duplicate from OP_Node :<
59  void writeIndent(std::ostream &os, int level);
60  void writeSpaces(std::ostream &os, int spaces);
61 };
62 
63 #endif
64 
GLint level
Definition: glcorearb.h:108
CH_ChannelBehavior
Definition: CH_Types.h:58
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10
GLuint GLfloat * val
Definition: glcorearb.h:1608
type
Definition: core.h:1059