#include <Network.h>
Inheritance diagram for PacketExecute:
Public Member Functions | |
PacketExecute () | |
~PacketExecute () | |
void | setStatementList (List stmtlist) |
void | setParams (List list) |
DbRetVal | marshall () |
DbRetVal | unmarshall () |
Data Fields | |
int | stmtID |
int | noParams |
char ** | paramValues |
List | paramList |
List | stmtList |
Definition at line 184 of file Network.h.
PacketExecute::PacketExecute | ( | ) | [inline] |
Definition at line 187 of file Network.h.
References BasePacket::buffer, BasePacket::bufferSize, NW_PKT_EXECUTE, and BasePacket::pktType.
00187 { buffer=NULL; bufferSize =0; pktType = NW_PKT_EXECUTE;}
PacketExecute::~PacketExecute | ( | ) | [inline] |
Definition at line 188 of file Network.h.
References BasePacket::buffer, and BasePacket::bufferSize.
00188 { free(buffer); bufferSize = 0; buffer = NULL; }
DbRetVal PacketExecute::marshall | ( | ) | [virtual] |
Implements BasePacket.
Definition at line 107 of file NetworkPacket.cxx.
References BasePacket::buffer, BasePacket::bufferSize, AllDataType::copyVal(), List::get(), BindSqlField::length, noParams, OK, paramList, AllDataType::size(), stmtID, BindSqlField::type, and BindSqlField::value.
Referenced by SqlLogStatement::execute().
00108 { 00109 bufferSize = sizeof(int)+ sizeof(int); 00110 BindSqlField* bindField = NULL; 00111 for (int i = 0 ; i < noParams; i++) 00112 { 00113 bindField = (BindSqlField*) paramList.get(i+1); 00114 bufferSize = bufferSize + AllDataType::size(bindField->type, bindField->length); 00115 } 00116 buffer = (char*) malloc(bufferSize); 00117 *(int*)buffer = stmtID; 00118 char* bufIter = (char*) buffer + sizeof(int); 00119 *(int*)bufIter = noParams; 00120 bufIter = (char*) bufIter + sizeof(int); 00121 for (int i = 0 ; i < noParams; i++) 00122 { 00123 bindField = (BindSqlField*) paramList.get(i+1); 00124 AllDataType::copyVal(bufIter, bindField->value, bindField->type,bindField->length); 00125 bufIter = bufIter + AllDataType::size(bindField->type, bindField->length); 00126 } 00127 return OK; 00128 }
Here is the call graph for this function:
Here is the caller graph for this function:
void PacketExecute::setParams | ( | List | list | ) |
Definition at line 89 of file NetworkPacket.cxx.
References List::get(), noParams, paramList, paramValues, List::size(), and BindSqlField::value.
Referenced by SqlLogStatement::execute().
00090 { 00091 paramList = list; 00092 noParams = list.size(); 00093 paramValues = new char*[noParams]; 00094 BindSqlField* bindField = NULL; 00095 for (int i = 0 ; i < noParams; i++) 00096 { 00097 bindField = (BindSqlField*) paramList.get(i+1); 00098 paramValues[i] = (char*) bindField->value; 00099 } 00100 return; 00101 }
Here is the call graph for this function:
Here is the caller graph for this function:
void PacketExecute::setStatementList | ( | List | stmtlist | ) |
Definition at line 102 of file NetworkPacket.cxx.
References stmtList.
Referenced by PacketCommit::getExecPacketList().
00103 { 00104 stmtList = stmtlist; 00105 return; 00106 }
Here is the caller graph for this function:
DbRetVal PacketExecute::unmarshall | ( | ) | [virtual] |
Implements BasePacket.
Definition at line 129 of file NetworkPacket.cxx.
References BasePacket::buffer, List::getIterator(), BindSqlField::length, noParams, OK, paramValues, AllDataType::size(), stmt, stmtID, stmtList, and BindSqlField::type.
Referenced by PacketCommit::getExecPacketList().
00130 { 00131 stmtID = *(int*)buffer; 00132 char *bufIter = buffer + sizeof(int); 00133 noParams = *(int*)bufIter; 00134 bufIter = bufIter +sizeof(int); 00135 ListIterator stmtIter = stmtList.getIterator(); 00136 NetworkStmt *stmt; 00137 while (stmtIter.hasElement()) 00138 { 00139 stmt = (NetworkStmt*) stmtIter.nextElement(); 00140 //TODO::Also check teh srcNetworkID 00141 if (stmt->stmtID == stmtID ) break; 00142 } 00143 if (noParams == 0) return OK; 00144 paramValues = new char*[noParams]; 00145 ListIterator paramIter = stmt->paramList.getIterator(); 00146 BindSqlField *bindField = NULL; 00147 for (int i=0; i <noParams; i++) 00148 { 00149 paramValues[i] = bufIter; 00150 bindField = (BindSqlField*) stmt->paramList.get(i+1); 00151 bufIter = bufIter + AllDataType::size(bindField->type, bindField->length); 00152 } 00153 return OK; 00154 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 192 of file Network.h.
Referenced by SqlLogStatement::execute(), marshall(), setParams(), and unmarshall().
char** PacketExecute::paramValues |
Definition at line 191 of file Network.h.
Referenced by SqlLogStatement::execute(), marshall(), and unmarshall().