Revision: 44384 http://brlcad.svn.sourceforge.net/brlcad/?rev=44384&view=rev Author: davidloman Date: 2011-04-14 16:46:50 +0000 (Thu, 14 Apr 2011)
Log Message: ----------- Formatting, ws. Modified Paths: -------------- geomcore/trunk/src/libNet/netMsg/FailureMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericFourBytesMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericMultiByteMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericOneByteMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericOneStringMsg.cxx geomcore/trunk/src/libNet/netMsg/GenericTwoBytesMsg.cxx geomcore/trunk/src/libNet/netMsg/GeometryChunkMsg.cxx geomcore/trunk/src/libNet/netMsg/GeometryManifestMsg.cxx geomcore/trunk/src/libNet/netMsg/GeometryReqMsg.cxx geomcore/trunk/src/libNet/netMsg/NetMsg.cxx geomcore/trunk/src/libNet/netMsg/NewNodeOnNetMsg.cxx geomcore/trunk/src/libNet/netMsg/NewSessionReqMsg.cxx geomcore/trunk/src/libNet/netMsg/PingMsg.cxx geomcore/trunk/src/libNet/netMsg/PongMsg.cxx geomcore/trunk/src/libNet/netMsg/RemoteNodenameSetMsg.cxx geomcore/trunk/src/libNet/netMsg/SessionInfoMsg.cxx geomcore/trunk/src/libNet/netMsg/SuccessMsg.cxx geomcore/trunk/src/libNet/netMsg/TypeOnlyMsg.cxx Modified: geomcore/trunk/src/libNet/netMsg/FailureMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/FailureMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/FailureMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -24,8 +24,6 @@ */ #include "FailureMsg.h" -#include "NetMsgTypes.h" -#include <sstream> /* Normal Constructor */ FailureMsg::FailureMsg(uint8_t failureCode): @@ -45,10 +43,15 @@ /* Destructor */ FailureMsg::~FailureMsg() {} + /* *Getters n Setters */ -uint8_t FailureMsg::getFailureCode() {return this->data;} +uint8_t +FailureMsg::getFailureCode() +{ + return this->data; +} /* * Local Variables: Modified: geomcore/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,69 +23,62 @@ * */ -#include <common.h> -#include "Logger.h" - #include "GenericEightBytesMsg.h" -#include <sstream> -#include <iostream> - -#include <bu.h> - /* Normal Constructor */ GenericEightBytesMsg::GenericEightBytesMsg(uint32_t type, uint64_t data) : - NetMsg(type), data(data) + NetMsg(type), data(data) {} /* Reply Constructor */ -GenericEightBytesMsg::GenericEightBytesMsg(uint32_t type, NetMsg* msg, uint64_t data) : - NetMsg(type, msg), data(data) +GenericEightBytesMsg::GenericEightBytesMsg(uint32_t type, NetMsg* msg, + uint64_t data) : + NetMsg(type, msg), data(data) {} /* Deserializing Constructor */ GenericEightBytesMsg::GenericEightBytesMsg(ByteBuffer* bb, Portal* origin) : - NetMsg(bb, origin) + NetMsg(bb, origin) { - data = bb->get64bit(); + data = bb->get64bit(); } /* Destructor */ GenericEightBytesMsg::~GenericEightBytesMsg() {} -bool GenericEightBytesMsg::_serialize(ByteBuffer* bb) +bool +GenericEightBytesMsg::_serialize(ByteBuffer* bb) { bb->put64bit(this->data); return true; } -std::string GenericEightBytesMsg::toString() +std::string +GenericEightBytesMsg::toString() { - char out[BUFSIZ]; - - snprintf(out, BUFSIZ, "%s\t data: '%llu'", NetMsg::toString().c_str(), (uint64_t)this->data); - - return std::string(out); + char out[BUFSIZ]; + snprintf(out, BUFSIZ, "%s\t data: '%llu'", NetMsg::toString().c_str(), + (uint64_t) this->data); + return std::string(out); } -bool GenericEightBytesMsg::_equals(const NetMsg& msg) +bool +GenericEightBytesMsg::_equals(const NetMsg& msg) { - GenericEightBytesMsg& gmsg = (GenericEightBytesMsg&) msg; - - if (this->getData() != gmsg.getData()) { - return false; - } - - return true; + GenericEightBytesMsg& gmsg = (GenericEightBytesMsg&) msg; + if (this->getData() != gmsg.getData()) + return false; + return true; } /* *Getters n Setters */ -uint64_t GenericEightBytesMsg::getData() +uint64_t +GenericEightBytesMsg::getData() { - return this->data; + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/GenericFourBytesMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericFourBytesMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericFourBytesMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -24,7 +24,6 @@ */ #include "GenericFourBytesMsg.h" -#include <sstream> /* Normal Constructor */ GenericFourBytesMsg::GenericFourBytesMsg(uint32_t type, uint32_t b) : @@ -40,45 +39,45 @@ GenericFourBytesMsg::GenericFourBytesMsg(ByteBuffer* bb, Portal* origin) : NetMsg(bb, origin) { - data = bb->get32bit(); + data = bb->get32bit(); } /* Destructor */ GenericFourBytesMsg::~GenericFourBytesMsg() {} -bool GenericFourBytesMsg::_serialize(ByteBuffer* bb) +bool +GenericFourBytesMsg::_serialize(ByteBuffer* bb) { bb->put32bit(this->data); return true; } -std::string GenericFourBytesMsg::toString() +std::string +GenericFourBytesMsg::toString() { - char out[BUFSIZ]; - - snprintf(out, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), this->data); - - return std::string(out); + char out[BUFSIZ]; + snprintf(out, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), + this->data); + return std::string(out); } -bool GenericFourBytesMsg::_equals(const NetMsg& msg) +bool +GenericFourBytesMsg::_equals(const NetMsg& msg) { - GenericFourBytesMsg& gmsg = (GenericFourBytesMsg&) msg; - - if (this->getData() != gmsg.getData()) { - return false; - } - - return true; + GenericFourBytesMsg& gmsg = (GenericFourBytesMsg&) msg; + if (this->getData() != gmsg.getData()) + return false; + return true; } /* *Getters n Setters */ -uint32_t GenericFourBytesMsg::getData() +uint32_t +GenericFourBytesMsg::getData() { - return this->data; + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/GenericMultiByteMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericMultiByteMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericMultiByteMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -24,41 +24,37 @@ */ #include "GenericMultiByteMsg.h" -#include <iostream> -#include <sstream> -#include <cstdlib> -#include <string.h> /* Normal Constructor */ GenericMultiByteMsg::GenericMultiByteMsg(uint32_t type, ByteBuffer* dataIn) : NetMsg(type) { - /* Deep copy */ - this->data = dataIn->duplicate(); + /* Deep copy */ + this->data = dataIn->duplicate(); } /* Reply Constructor */ GenericMultiByteMsg::GenericMultiByteMsg(uint32_t type, NetMsg* msg, ByteBuffer* dataIn) : NetMsg(type, msg) { - /* Deep copy */ - this->data = dataIn->duplicate(); + /* Deep copy */ + this->data = dataIn->duplicate(); } /* Deserializing Constructor */ GenericMultiByteMsg::GenericMultiByteMsg(ByteBuffer* bb, Portal* origin) : NetMsg(bb, origin) { - int len = bb->get32bit(); - this->data = ByteBuffer::allocate(len + 1); + int len = bb->get32bit(); + this->data = ByteBuffer::allocate(len + 1); - bb->get(this->data->array(), len); + bb->get(this->data->array(), len); } /* Destructor */ GenericMultiByteMsg::~GenericMultiByteMsg() { - free(this->data); + free(this->data); } bool GenericMultiByteMsg::_serialize(ByteBuffer* bb) @@ -78,27 +74,23 @@ std::string GenericMultiByteMsg::toString() { - std::string out = NetMsg::toString(); - out += "\t" + this->data->toString(); - return out; + std::string out = NetMsg::toString(); + out += "\t" + this->data->toString(); + return out; } bool GenericMultiByteMsg::_equals(const NetMsg& msg) { - GenericMultiByteMsg& gmsg = (GenericMultiByteMsg&) msg; + GenericMultiByteMsg& gmsg = (GenericMultiByteMsg&) msg; - if (this->getDataLen() != gmsg.getDataLen()) { - std::cout << "\n1\n"; - return false; - } + if (this->getDataLen() != gmsg.getDataLen()) + return false; - for (uint32_t i = 0; i < gmsg.getDataLen(); ++i) { - if (this->getData()[i] != gmsg.getData()[i]) { - return false; - } - } + for (uint32_t i = 0; i < gmsg.getDataLen(); ++i) + if (this->getData()[i] != gmsg.getData()[i]) + return false; - return true; + return true; } /* @@ -106,17 +98,18 @@ */ char* GenericMultiByteMsg::getData() { - return this->data->array(); + return this->data->array(); } + uint32_t GenericMultiByteMsg::getDataLen() { - return this->data->position(); + return this->data->position(); } ByteBuffer* GenericMultiByteMsg::getByteBuffer() { - return new ByteBuffer(*this->data); + return new ByteBuffer(*this->data); } /* Modified: geomcore/trunk/src/libNet/netMsg/GenericOneByteMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericOneByteMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericOneByteMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -24,16 +24,15 @@ */ #include "GenericOneByteMsg.h" -#include <sstream> /* Normal Constructor */ GenericOneByteMsg::GenericOneByteMsg(uint32_t type, uint8_t b) : - NetMsg(type), data(b) + NetMsg(type), data(b) {} /* Reply Constructor */ GenericOneByteMsg::GenericOneByteMsg(uint32_t type, NetMsg* msg, uint8_t b) : - NetMsg(type, msg), data(b) + NetMsg(type, msg), data(b) {} /* Deserializing Constructor */ @@ -47,33 +46,36 @@ GenericOneByteMsg::~GenericOneByteMsg() {} -bool GenericOneByteMsg::_serialize(ByteBuffer* bb) +bool +GenericOneByteMsg::_serialize(ByteBuffer* bb) { bb->put(this->data); return true; } -std::string GenericOneByteMsg::toString() +std::string +GenericOneByteMsg::toString() { - char buf[BUFSIZ]; - - snprintf(buf, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), this->data); - - return std::string(buf); + char buf[BUFSIZ]; + snprintf(buf, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), + this->data); + return std::string(buf); } -bool GenericOneByteMsg::_equals(const NetMsg& msg) +bool +GenericOneByteMsg::_equals(const NetMsg& msg) { - GenericOneByteMsg& gmsg = (GenericOneByteMsg&) msg; - return (this->getData() == gmsg.getData()); + GenericOneByteMsg& gmsg = (GenericOneByteMsg&) msg; + return (this->getData() == gmsg.getData()); } /* *Getters n Setters */ -uint8_t GenericOneByteMsg::getData() +uint8_t +GenericOneByteMsg::getData() { - return this->data; + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/GenericOneStringMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericOneStringMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericOneStringMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,9 +23,7 @@ * */ - #include "GenericOneStringMsg.h" -#include <sstream> /* Normal Constructor */ GenericOneStringMsg::GenericOneStringMsg(uint32_t type, std::string s) : @@ -41,47 +39,49 @@ GenericOneStringMsg::GenericOneStringMsg(ByteBuffer* bb, Portal* origin) : NetMsg(bb, origin) { - this->strData = bb->getString(); + this->strData = bb->getString(); } /* Destructor */ GenericOneStringMsg::~GenericOneStringMsg() {} -bool GenericOneStringMsg::_serialize(ByteBuffer* bb) +bool +GenericOneStringMsg::_serialize(ByteBuffer* bb) { - bb->putString(this->strData); - return true; + bb->putString(this->strData); + return true; } -std::string GenericOneStringMsg::toString() +std::string +GenericOneStringMsg::toString() { - std::string out; + std::string out; - out.append(NetMsg::toString()); - out.append("\t strData: '"); - out.append(this->strData + "'"); + out.append(NetMsg::toString()); + out.append("\t strData: '"); + out.append(this->strData + "'"); - return out; + return out; } -bool GenericOneStringMsg::_equals(const NetMsg& msg) +bool +GenericOneStringMsg::_equals(const NetMsg& msg) { - GenericOneStringMsg& gmsg = (GenericOneStringMsg&) msg; + GenericOneStringMsg& gmsg = (GenericOneStringMsg&) msg; - if (this->getStrData() != gmsg.getStrData()) { - return false; - } - - return true; + if (this->getStrData() != gmsg.getStrData()) + return false; + return true; } /* *Getters n Setters */ -std::string GenericOneStringMsg::getStrData() +std::string +GenericOneStringMsg::getStrData() { - return this->strData; + return this->strData; } /* Modified: geomcore/trunk/src/libNet/netMsg/GenericTwoBytesMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GenericTwoBytesMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GenericTwoBytesMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,10 +23,7 @@ * */ -#include <arpa/inet.h> - #include "GenericTwoBytesMsg.h" -#include <sstream> /* Normal Constructor */ GenericTwoBytesMsg::GenericTwoBytesMsg(uint32_t type, uint16_t b) : @@ -49,38 +46,39 @@ GenericTwoBytesMsg::~GenericTwoBytesMsg() {} -bool GenericTwoBytesMsg::_serialize(ByteBuffer* bb) +bool +GenericTwoBytesMsg::_serialize(ByteBuffer* bb) { bb->put16bit(this->data); return true; } -std::string GenericTwoBytesMsg::toString() +std::string +GenericTwoBytesMsg::toString() { - char buf[BUFSIZ]; - - snprintf(buf, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), this->data); - - return std::string(buf); + char buf[BUFSIZ]; + snprintf(buf, BUFSIZ, "%s\t data: '%d'", NetMsg::toString().c_str(), + this->data); + return std::string(buf); } -bool GenericTwoBytesMsg::_equals(const NetMsg& msg) +bool +GenericTwoBytesMsg::_equals(const NetMsg& msg) { - GenericTwoBytesMsg& gmsg = (GenericTwoBytesMsg&) msg; + GenericTwoBytesMsg& gmsg = (GenericTwoBytesMsg&) msg; - if (this->getData() != gmsg.getData()) { - return false; - } - - return true; + if (this->getData() != gmsg.getData()) + return false; + return true; } /* *Getters n Setters */ -uint16_t GenericTwoBytesMsg::getData() +uint16_t +GenericTwoBytesMsg::getData() { - return this->data; + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/GeometryChunkMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GeometryChunkMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GeometryChunkMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,24 +23,22 @@ * */ -#include "NetMsgTypes.h" #include "GeometryChunkMsg.h" -#include <sstream> #include <raytrace.h> /* Normal Constructor */ GeometryChunkMsg::GeometryChunkMsg(std::string path, ByteBuffer* dataIn) : - GenericMultiByteMsg(GEOMETRYCHUNK, dataIn), path(path) + GenericMultiByteMsg(GEOMETRYCHUNK, dataIn), path(path) {} /* Reply Constructor */ GeometryChunkMsg::GeometryChunkMsg(NetMsg* msg, std::string path, ByteBuffer* dataIn) : - GenericMultiByteMsg(GEOMETRYCHUNK, msg, dataIn), path(path) + GenericMultiByteMsg(GEOMETRYCHUNK, msg, dataIn), path(path) {} /* Deserializing Constructor */ GeometryChunkMsg::GeometryChunkMsg(ByteBuffer* bb, Portal* origin) : - GenericMultiByteMsg(bb, origin) + GenericMultiByteMsg(bb, origin) { this->path = bb->getString(); } @@ -77,20 +75,19 @@ { GeometryChunkMsg& gmsg = (GeometryChunkMsg&) msg; - if (this->getDataLen() != gmsg.getDataLen()) - return false; + if (this->getDataLen() != gmsg.getDataLen()) + return false; - for (uint32_t i = 0; i < gmsg.getDataLen(); ++i) - if (this->getData()[i] != gmsg.getData()[i]) - return false; + for (uint32_t i = 0; i < gmsg.getDataLen(); ++i) + if (this->getData()[i] != gmsg.getData()[i]) + return false; - if (this->path != gmsg.path) - return false; + if (this->path != gmsg.path) + return false; - return true; + return true; } - GeometryChunkMsg* GeometryChunkMsg::objToChunk(BRLCAD::MinimalObject* obj, NetMsg* replyMsg) { @@ -117,45 +114,43 @@ BRLCAD::MinimalObject* GeometryChunkMsg::chunkToObj(GeometryChunkMsg* msg) { - if (msg == NULL) { - bu_log("NULL msg"); - return NULL; - } + if (msg == NULL) { + bu_log("NULL msg"); + return NULL; + } - ByteBuffer* bb = msg->getByteBuffer(); + ByteBuffer* bb = msg->getByteBuffer(); - if (bb == NULL){ - bu_log("NULL ByteBuffer"); - return NULL; - } + if (bb == NULL){ + bu_log("NULL ByteBuffer"); + return NULL; + } + bu_external* ext = (bu_external*)bu_calloc(1,sizeof(bu_external),"chunkToExt bu_external calloc");; - bu_external* ext = (bu_external*)bu_calloc(1,sizeof(bu_external),"chunkToExt bu_external calloc");; + size_t len = bb->position(); - size_t len = bb->position(); + /* Build bu_external */ + ext->ext_buf = (uint8_t*)bu_calloc(1,len,"chunkToExt bu_external calloc"); + memcpy(ext->ext_buf, bb->array(), len); - /* Build bu_external */ - ext->ext_buf = (uint8_t*)bu_calloc(1,len,"chunkToExt bu_external calloc"); - memcpy(ext->ext_buf, bb->array(), len); + /* Get object name */ + struct db5_raw_internal raw; + if (db5_get_raw_internal_ptr(&raw, (const unsigned char *)bb->array()) == NULL) { + bu_log("Corrupted serialized geometry? Could not deserialize.\n"); + return NULL; + } - /* Get object name */ - struct db5_raw_internal raw; - if (db5_get_raw_internal_ptr(&raw, (const unsigned char *)bb->array()) == NULL) { - bu_log("Corrupted serialized geometry? Could not deserialize.\n"); - return NULL; - } + if (raw.name.ext_nbytes < 1) { + bu_log("Failed to retrieve object name. Could not deserialize.\n"); + return NULL; + } - if (raw.name.ext_nbytes < 1) { - bu_log("Failed to retrieve object name. Could not deserialize.\n"); - return NULL; - } + std::string name((char*)raw.name.ext_buf); - std::string name((char*)raw.name.ext_buf); - - return new BRLCAD::MinimalObject(msg->getPath(), name, ext); + return new BRLCAD::MinimalObject(msg->getPath(), name, ext); } - /* * Local Variables: * mode: C Modified: geomcore/trunk/src/libNet/netMsg/GeometryManifestMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GeometryManifestMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GeometryManifestMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,14 +23,9 @@ * */ -#include <arpa/inet.h> - -#include <string> #include <iostream> -#include "NetMsgTypes.h" #include "GeometryManifestMsg.h" - /* Normal Constructor */ GeometryManifestMsg::GeometryManifestMsg(std::list<std::string>& items) : NetMsg(GEOMETRYMANIFEST) @@ -47,37 +42,38 @@ /* Deserializing Constructor */ GeometryManifestMsg::GeometryManifestMsg(ByteBuffer* bb, Portal* origin) : - NetMsg(bb, origin) + NetMsg(bb, origin) { - this->itemData = new std::list<std::string> (); + this->itemData = new std::list<std::string>(); - uint32_t numOfItems = bb->get32bit(); + uint32_t numOfItems = bb->get32bit(); - std::cout << "Attempting to deserialize " << numOfItems << " items.\n"; + std::cout << "Attempting to deserialize " << numOfItems << " items.\n"; - std::string tstr; + std::string tstr; - for (uint32_t i = 0; i < numOfItems; ++i) { - std::cout << i << ")"; + for (uint32_t i = 0; i < numOfItems; ++i) { + std::cout << i << ")"; - tstr = bb->getString(); - if (tstr.size() == 0) { + tstr = bb->getString(); + if (tstr.size() == 0) { std::cout << "Skipping zero Len String."; continue; } - this->itemData->push_back(tstr); - std::cout << std::endl; + this->itemData->push_back(tstr); + std::cout << std::endl; } } /* Destructor */ GeometryManifestMsg::~GeometryManifestMsg() { - delete this->itemData; + delete this->itemData; } -bool GeometryManifestMsg::_serialize(ByteBuffer* bb) +bool +GeometryManifestMsg::_serialize(ByteBuffer* bb) { /* put in placeholder for count */ int start = bb->position(); @@ -85,67 +81,74 @@ int cnt = 0; std::string tstr; - for (std::list<std::string>::iterator it = this->itemData->begin(); it != this->itemData->end(); it++) - { - tstr = *it; - if (tstr.size() == 0) { - std::cout << "Skipping zero Len String."; - continue; - } - bb->putString(tstr); - ++cnt; + for (std::list<std::string>::iterator it = this->itemData->begin(); it + != this->itemData->end(); it++) { + tstr = *it; + if (tstr.size() == 0) { + std::cout << "Skipping zero Len String."; + continue; + } + bb->putString(tstr); + ++cnt; } - int stop = bb->position(); - /* Go back and insert actual count */ - bb->setPosition(start); - bb->put32bit(cnt); - bb->setPosition(stop); + int stop = bb->position(); + /* Go back and insert actual count */ + bb->setPosition(start); + bb->put32bit(cnt); + bb->setPosition(stop); - return true; + return true; } -bool GeometryManifestMsg::_equals(const NetMsg& msg) +bool +GeometryManifestMsg::_equals(const NetMsg& msg) { - GeometryManifestMsg& gmsg = (GeometryManifestMsg&) msg; - if( this->itemData->size() != gmsg.itemData->size() ) - return false; - std::list<std::string>::iterator it = this->itemData->begin(), git = gmsg.itemData->begin(); + GeometryManifestMsg& gmsg = (GeometryManifestMsg&) msg; + if (this->itemData->size() != gmsg.itemData->size()) + return false; + std::list<std::string>::iterator it = this->itemData->begin(), git = + gmsg.itemData->begin(); - for (; it != this->itemData->end(); it++, git++) - if (*it != *git) - return false; - return true; + for (; it != this->itemData->end(); it++, git++) + if (*it != *git) + return false; + return true; } -std::string GeometryManifestMsg::toString() +std::string +GeometryManifestMsg::toString() { - char buf[BUFSIZ]; - std::string out; + char buf[BUFSIZ]; + std::string out; - snprintf(buf, BUFSIZ, "%s numberofItems: %d", NetMsg::toString().c_str(), (int)this->itemData->size()); + snprintf(buf, BUFSIZ, "%s numberofItems: %d", NetMsg::toString().c_str(), + (int) this->itemData->size()); - for (std::list<std::string>::iterator it=this->itemData->begin(); it != this->itemData->end(); it++) { - snprintf(buf, BUFSIZ, "\n\t '%s'", it->c_str()); - out.append(buf); + for (std::list<std::string>::iterator it = this->itemData->begin(); it + != this->itemData->end(); it++) { + snprintf(buf, BUFSIZ, "\n\t '%s'", it->c_str()); + out.append(buf); } - out.append("\n"); + out.append("\n"); - return out; + return out; } /* *Getters n Setters */ -uint32_t GeometryManifestMsg::getNumOfItems() +uint32_t +GeometryManifestMsg::getNumOfItems() { - return this->itemData->size(); + return this->itemData->size(); } -std::list<std::string>* GeometryManifestMsg::getItemData() +std::list<std::string>* +GeometryManifestMsg::getItemData() { - return this->itemData; + return this->itemData; } /* Modified: geomcore/trunk/src/libNet/netMsg/GeometryReqMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/GeometryReqMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/GeometryReqMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,71 +23,69 @@ * */ -#include "NetMsgTypes.h" #include "GeometryReqMsg.h" /* Normal Constructor */ GeometryReqMsg::GeometryReqMsg(std::string path, bool recurse) : - GenericOneStringMsg(GEOMETRYREQ, path), recurse(recurse) + GenericOneStringMsg(GEOMETRYREQ, path), recurse(recurse) {} /* Reply Constructor */ GeometryReqMsg::GeometryReqMsg(NetMsg* msg, std::string path, bool recurse) : - GenericOneStringMsg(GEOMETRYREQ, msg, path), recurse(recurse) + GenericOneStringMsg(GEOMETRYREQ, msg, path), recurse(recurse) {} /* Deserializing Constructor */ GeometryReqMsg::GeometryReqMsg(ByteBuffer* bb, Portal* origin) : - GenericOneStringMsg(bb, origin) + GenericOneStringMsg(bb, origin) { - this->recurse = bb->get(); + this->recurse = bb->get(); } /* Destructor */ GeometryReqMsg::~GeometryReqMsg() {} -bool GeometryReqMsg::_serialize(ByteBuffer* bb) +bool +GeometryReqMsg::_serialize(ByteBuffer* bb) { - /* Call the super */ - GenericOneStringMsg::_serialize(bb); - bb->put(this->recurse); - - return true; + /* Call the super */ + GenericOneStringMsg::_serialize(bb); + bb->put(this->recurse); + return true; } -std::string GeometryReqMsg::toString() +std::string +GeometryReqMsg::toString() { - char out[BUFSIZ]; - - snprintf(out, BUFSIZ, "%s' recurse: '%d'", GenericOneStringMsg::toString().c_str(), this->recurse); - - return std::string(out); + char out[BUFSIZ]; + snprintf(out, BUFSIZ, "%s' recurse: '%d'", + GenericOneStringMsg::toString().c_str(), this->recurse); + return std::string(out); } -bool GeometryReqMsg::_equals(const NetMsg& msg) +bool +GeometryReqMsg::_equals(const NetMsg& msg) { - GeometryReqMsg& gmsg = (GeometryReqMsg&) msg; - - if (this->getRecurse() != gmsg.getRecurse()) { - return false; - } - - return true; + GeometryReqMsg& gmsg = (GeometryReqMsg&) msg; + if (this->getRecurse() != gmsg.getRecurse()) + return false; + return true; } /* *Getters n Setters */ -bool GeometryReqMsg::getRecurse() +bool +GeometryReqMsg::getRecurse() { - return this->recurse; + return this->recurse; } std::string GeometryReqMsg::getPath() { - return this->strData; + return this->strData; } /* Modified: geomcore/trunk/src/libNet/netMsg/NetMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/NetMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/NetMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,7 +23,6 @@ * */ - #include "NetMsg.h" #include "Portal.h" Modified: geomcore/trunk/src/libNet/netMsg/NewNodeOnNetMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/NewNodeOnNetMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/NewNodeOnNetMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,7 +23,6 @@ * */ -#include "NetMsgTypes.h" #include "NewNodeOnNetMsg.h" /* Normal Constructor */ @@ -48,7 +47,8 @@ /* *Getters n Setters */ -std::string NewNodeOnNetMsg::getNewNodename() +std::string +NewNodeOnNetMsg::getNewNodename() { return this->strData; } Modified: geomcore/trunk/src/libNet/netMsg/NewSessionReqMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/NewSessionReqMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/NewSessionReqMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,7 +23,6 @@ * */ -#include "NetMsgTypes.h" #include "NewSessionReqMsg.h" /* Normal Constructor */ @@ -48,46 +47,47 @@ NewSessionReqMsg::~NewSessionReqMsg() {} -bool NewSessionReqMsg::_serialize(ByteBuffer* bb) +bool +NewSessionReqMsg::_serialize(ByteBuffer* bb) { - bb->putString(this->uname); - bb->putString(this->passwd); - return true; + bb->putString(this->uname); + bb->putString(this->passwd); + return true; } -std::string NewSessionReqMsg::toString() +std::string +NewSessionReqMsg::toString() { - char out[BUFSIZ]; - - snprintf(out, BUFSIZ, "%s\t uname: %s\t passwd: %s", NetMsg::toString().c_str(), this->uname.c_str(), this->passwd.c_str()); - - return std::string(out); + char out[BUFSIZ]; + snprintf(out, BUFSIZ, "%s\t uname: %s\t passwd: %s", + NetMsg::toString().c_str(), this->uname.c_str(), this->passwd.c_str()); + return std::string(out); } -bool NewSessionReqMsg::_equals(const NetMsg& msg) +bool +NewSessionReqMsg::_equals(const NetMsg& msg) { - NewSessionReqMsg& gmsg = (NewSessionReqMsg&) msg; + NewSessionReqMsg& gmsg = (NewSessionReqMsg&) msg; - if (this->uname != gmsg.uname) { - return false; - } - if (this->passwd != gmsg.passwd) { - return false; - } - - return true; + if (this->uname != gmsg.uname) + return false; + if (this->passwd != gmsg.passwd) + return false; + return true; } /* *Getters n Setters */ -std::string NewSessionReqMsg::getUName() +std::string +NewSessionReqMsg::getUName() { - return this->uname; + return this->uname; } -std::string NewSessionReqMsg::getPasswd() +std::string +NewSessionReqMsg::getPasswd() { - return this->passwd; + return this->passwd; } /* Modified: geomcore/trunk/src/libNet/netMsg/PingMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/PingMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/PingMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -20,7 +20,6 @@ /** @file PingMsg.cxx * PingMsg.cxx * - * Created on: Dec 20, 2010 */ #include "NetMsgTypes.h" Modified: geomcore/trunk/src/libNet/netMsg/PongMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/PongMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/PongMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -32,8 +32,9 @@ PongMsg::~PongMsg(){} uint64_t -PongMsg::getStartTime(){ - return this->data; +PongMsg::getStartTime() +{ + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/RemoteNodenameSetMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/RemoteNodenameSetMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/RemoteNodenameSetMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -49,9 +49,10 @@ /* *Getters n Setters */ -std::string RemoteNodenameSetMsg::getRemoteNodename() +std::string +RemoteNodenameSetMsg::getRemoteNodename() { - return this->strData; + return this->strData; } /* Modified: geomcore/trunk/src/libNet/netMsg/SessionInfoMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/SessionInfoMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/SessionInfoMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,11 +23,8 @@ * */ -#include "NetMsgTypes.h" #include "SessionInfoMsg.h" -#include <sstream> - /* Normal Constructor */ SessionInfoMsg::SessionInfoMsg(GSUuid* sessionID) : NetMsg(SESSIONINFO), sessionID(sessionID) @@ -49,40 +46,42 @@ SessionInfoMsg::~SessionInfoMsg() {} -bool SessionInfoMsg::_serialize(ByteBuffer* bb) +bool +SessionInfoMsg::_serialize(ByteBuffer* bb) { - bb->putString(*this->sessionID->toString()); - return true; + bb->putString(*this->sessionID->toString()); + return true; } -std::string SessionInfoMsg::toString() +std::string +SessionInfoMsg::toString() { - std::string out; + std::string out; - out.append(NetMsg::toString()); - out.append("\t SessionID: "); - out.append(*this->sessionID->toString()); + out.append(NetMsg::toString()); + out.append("\t SessionID: "); + out.append(*this->sessionID->toString()); - return out; + return out; } -bool SessionInfoMsg::_equals(const NetMsg& msg) +bool +SessionInfoMsg::_equals(const NetMsg& msg) { - SessionInfoMsg& gmsg = (SessionInfoMsg&) msg; + SessionInfoMsg& gmsg = (SessionInfoMsg&) msg; - if (! this->getSessionID()->equals(gmsg.getSessionID())) { - return false; - } - - return true; + if (!this->getSessionID()->equals(gmsg.getSessionID())) + return false; + return true; } /* *Getters n Setters */ -GSUuid* SessionInfoMsg::getSessionID() +GSUuid* +SessionInfoMsg::getSessionID() { - return this->sessionID; + return this->sessionID; } /* Modified: geomcore/trunk/src/libNet/netMsg/SuccessMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/SuccessMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/SuccessMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,9 +23,7 @@ * */ -#include "NetMsgTypes.h" #include "SuccessMsg.h" -#include <sstream> /* Normal Constructor */ SuccessMsg::SuccessMsg(uint8_t successCode) : @@ -49,9 +47,10 @@ /* *Getters n Setters */ -uint8_t SuccessMsg::getSuccessCode() +uint8_t +SuccessMsg::getSuccessCode() { - return this->data; + return this->data; } /* Modified: geomcore/trunk/src/libNet/netMsg/TypeOnlyMsg.cxx =================================================================== --- geomcore/trunk/src/libNet/netMsg/TypeOnlyMsg.cxx 2011-04-14 13:58:39 UTC (rev 44383) +++ geomcore/trunk/src/libNet/netMsg/TypeOnlyMsg.cxx 2011-04-14 16:46:50 UTC (rev 44384) @@ -23,9 +23,7 @@ * */ -#include "NetMsgTypes.h" #include "TypeOnlyMsg.h" -#include <sstream> /* Normal Constructor */ TypeOnlyMsg::TypeOnlyMsg(uint32_t msgType) : @@ -46,14 +44,16 @@ TypeOnlyMsg::~TypeOnlyMsg() {} -bool TypeOnlyMsg::_serialize(ByteBuffer* bb) +bool +TypeOnlyMsg::_serialize(ByteBuffer* bb) { - return true; + return true; } -bool TypeOnlyMsg::_equals(const NetMsg& msg) +bool +TypeOnlyMsg::_equals(const NetMsg& msg) { - return true; + return true; } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits