#include <gl_Cg_code_instructor.h>
Public Member Functions | |
const std::string & | getClassName () const |
Returns name of class of our object. | |
size_t | getEndOfCycle (size_t line) const |
Returns line number with ending of cycle. | |
size_t | getExternalFunctionBody (const std::string &FunctionName) const |
Returns first line in definition of given function. | |
std::string | getExternalFunctionName (size_t line) const |
std::string | getLanguageID () const |
const std::string & | getObjectName () const |
Returns name of our object. | |
void | getSpecificParameter (const std::string &ParameterName, void *ParameterValue) |
Method for obtaining some specific parameters, such as texture specific params, and so on. | |
GLCgCodeInstructor () | |
std::string | instruct (size_t line, const std::string &variable) |
Set instruction in given position in source code. | |
bool | isCycle (size_t line) const |
Defines if our line is inside cycle. | |
bool | isExternalFunctionCalling (size_t line) const |
Defines if our line is calling of external function: function which has source (function that is not in standart library for shader). | |
bool | isLocked () const |
returns state of object. | |
void | setOriginalSource (const std::string &OriginalSource) |
~GLCgCodeInstructor () | |
Protected Member Functions | |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) |
void | lock () |
void | unlock () |
Private Attributes | |
std::string | mOriginalSource |
Static Private Attributes | |
static const std::string | mSourceFooter |
Definition at line 48 of file gl_Cg_code_instructor.h.
gpucalc::debugger::GLCgCodeInstructor::GLCgCodeInstructor | ( | ) |
Definition at line 61 of file gl_Cg_code_instructor.cpp.
00061 : CodeInstructor(_GLCgCodeInstructorName), mOriginalSource() 00062 { 00063 }
gpucalc::debugger::GLCgCodeInstructor::~GLCgCodeInstructor | ( | ) |
void gpucalc::Object::addSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue, | |||
size_t | Size | |||
) | [inline, protected, inherited] |
Definition at line 254 of file object.h.
00255 { 00256 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00257 if (i != mSpecificParameters.end()) 00258 { 00259 mSpecificParameters.erase(i); 00260 } 00261 mSpecificParameters[ParameterName] = Any(ParameterValue, Size); 00262 }
const std::string& gpucalc::Object::getClassName | ( | ) | const [inline, inherited] |
Returns name of class of our object.
Definition at line 92 of file object.h.
00093 { 00094 return mClassName; 00095 }
size_t gpucalc::debugger::GLCgCodeInstructor::getEndOfCycle | ( | size_t | line | ) | const [virtual] |
Returns line number with ending of cycle.
Uses in Debugger::stepOver()
Implements gpucalc::debugger::CodeInstructor.
Definition at line 91 of file gl_Cg_code_instructor.cpp.
size_t gpucalc::debugger::GLCgCodeInstructor::getExternalFunctionBody | ( | const std::string & | FunctionName | ) | const [virtual] |
Returns first line in definition of given function.
Uses in Debugger::stepInto()
Implements gpucalc::debugger::CodeInstructor.
Definition at line 103 of file gl_Cg_code_instructor.cpp.
std::string gpucalc::debugger::GLCgCodeInstructor::getExternalFunctionName | ( | size_t | line | ) | const [virtual] |
Implements gpucalc::debugger::CodeInstructor.
Definition at line 97 of file gl_Cg_code_instructor.cpp.
std::string gpucalc::debugger::GLCgCodeInstructor::getLanguageID | ( | ) | const [inline, virtual] |
Implements gpucalc::debugger::CodeInstructor.
Definition at line 61 of file gl_Cg_code_instructor.h.
const std::string& gpucalc::Object::getObjectName | ( | ) | const [inline, inherited] |
Returns name of our object.
Definition at line 101 of file object.h.
00102 { 00103 return mObjectName; 00104 }
void gpucalc::Object::getSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue | |||
) | [inline, inherited] |
Method for obtaining some specific parameters, such as texture specific params, and so on.
ParameterName | - name of parameter, usually it similar to specific method of some object (for example, GLTextureID) | |
ParameterValue | - contain value of named parameter, it must be allocated and have sufficient size. |
Definition at line 128 of file object.h.
00129 { 00130 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00131 if (i != mSpecificParameters.end()) 00132 { 00133 i->second.copyValue(ParameterValue); 00134 } 00135 else 00136 { 00137 Except<ERR_ITEM_NOT_FOUND>(this, "Parameter \"" + ParameterName + "\" does not exists.", "Object::getSpecificParameter()", __FILE__, __LINE__); 00138 } 00139 }
std::string gpucalc::debugger::GLCgCodeInstructor::instruct | ( | size_t | line, | |
const std::string & | variable | |||
) | [virtual] |
Set instruction in given position in source code.
Implements gpucalc::debugger::CodeInstructor.
Definition at line 71 of file gl_Cg_code_instructor.cpp.
00072 { 00073 StringList ShaderSource = auxillary::StringUtil::split(mOriginalSource); 00074 ShaderSource.insert(ShaderSource.begin() + line - 1, std::string("debug(float4_cast_debug(" + variable + "));")); 00075 return mSourceFooter + auxillary::StringUtil::concatenate(ShaderSource); 00076 }
bool gpucalc::debugger::GLCgCodeInstructor::isCycle | ( | size_t | line | ) | const [virtual] |
Defines if our line is inside cycle.
Implements gpucalc::debugger::CodeInstructor.
Definition at line 79 of file gl_Cg_code_instructor.cpp.
bool gpucalc::debugger::GLCgCodeInstructor::isExternalFunctionCalling | ( | size_t | line | ) | const [virtual] |
Defines if our line is calling of external function: function which has source (function that is not in standart library for shader).
Implements gpucalc::debugger::CodeInstructor.
Definition at line 85 of file gl_Cg_code_instructor.cpp.
bool gpucalc::Object::isLocked | ( | ) | const [inline, inherited] |
void gpucalc::Object::lock | ( | ) | [inline, protected, inherited] |
void gpucalc::debugger::GLCgCodeInstructor::setOriginalSource | ( | const std::string & | OriginalSource | ) | [inline, virtual] |
Implements gpucalc::debugger::CodeInstructor.
Definition at line 67 of file gl_Cg_code_instructor.h.
00068 { 00069 mOriginalSource = OriginalSource; 00070 }
void gpucalc::Object::unlock | ( | ) | [inline, protected, inherited] |
std::string gpucalc::debugger::GLCgCodeInstructor::mOriginalSource [private] |
Definition at line 96 of file gl_Cg_code_instructor.h.
const std::string gpucalc::debugger::GLCgCodeInstructor::mSourceFooter [static, private] |
Initial value:
"\ float4 float4_cast_debug(float x)\ {\ return float4(x,0,0,0);\ }\ float4 float4_cast_debug(float2 x)\ {\ return float4(x,0,0);\ }\ float4 float4_cast_debug(float3 x)\ {\ return float4(x,0);\ }\ float4 float4_cast_debug(float4 x)\ {\ return x;\ }\n\n"
Definition at line 93 of file gl_Cg_code_instructor.h.