HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <iosfwd>
20 
22 {
23 public:
24  CH_WriteCode();
25  virtual ~CH_WriteCode();
26 
27  // os is output stream to write the new function call. gs is
28  // the global stream to put the data.
29  // prefix is the file level prefix, a channel specific name
30  // will be appended.
31  // Force type is one of CH_ChannelBehavior. -1 doesn't cause
32  // any forcing to occur.
33  int writeCode(CH_Channel *chan, std::ostream &os,
34  std::ostream &gs,
35  const UT_String &prefix,
36  const UT_String &mainprefix, int isstatic = 1,
37  int forcetype = -1);
38 
39  // This function expands expressions:
40  virtual void expandExpression(UT_String &expr);
41 
42  // These mark the start and end of each call back functions expandExpression
43  // region. They both write BEFORE the result of expandExpression
44  // is written.
45  virtual void startExpressionBlock(std::ostream &gs);
46  virtual void stopExpressionBlock(std::ostream &gs);
47 
48  static void writeChannelType(std::ostream &os, CH_ChannelBehavior type);
49 
50  // Writes a proper C++ fpreal with the "F" qualifier.
51  static void writeFloat(std::ostream &os, fpreal val);
52 
53 protected:
54  // Duplicate from OP_Node :<
56  void writeIndent(std::ostream &os, int level);
57  void writeSpaces(std::ostream &os, int spaces);
58 };
59 
60 #endif
61 
GLint level
Definition: glcorearb.h:107
CH_ChannelBehavior
Definition: CH_Channel.h:39
double fpreal
Definition: SYS_Types.h:269
#define CH_API
Definition: CH_API.h:10
GLuint GLfloat * val
Definition: glcorearb.h:1607
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107