SpikeStream Library  0.2
NetworkInfo.cpp
Go to the documentation of this file.
00001 #include "NetworkInfo.h"
00002 #include "GlobalVariables.h"
00003 #include "SpikeStreamException.h"
00004 using namespace spikestream;
00005 
00006 
00008 NetworkInfo::NetworkInfo(unsigned int id, const QString& name, const QString& desc){
00009     //Check that name and description will fit in the database
00010     if(name.size() > MAX_DATABASE_NAME_LENGTH || description.size() > MAX_DATABASE_DESCRIPTION_LENGTH)
00011                 throw SpikeStreamException("NeuralNetwork: Name and/or description length exceeds maximum possible size in database.");
00012 
00013     this->id = id;
00014     this->name = name;
00015     this->description = desc;
00016 }
00017 
00018 
00020 NetworkInfo::NetworkInfo(){
00021     id = 0;
00022     name = "undefined";
00023     description = "undefined";
00024 }
00025 
00026 
00028 NetworkInfo::NetworkInfo(const NetworkInfo& netInfo){
00029     this->id = netInfo.id;
00030     this->name = netInfo.name;
00031     this->description = netInfo.description;
00032 }
00033 
00034 
00036 NetworkInfo::~NetworkInfo(){
00037 }
00038 
00039 
00040 /*--------------------------------------------------------- */
00041 /*-----                PUBLIC METHODS                 ----- */
00042 /*--------------------------------------------------------- */
00043 
00045 NetworkInfo& NetworkInfo::operator=(const NetworkInfo& rhs) {
00046     // Check for self-assignment!
00047     if (this == &rhs)      // Same object?
00048                 return *this;        // Yes, so skip assignment, and just return *this.
00049 
00050     this->id = rhs.id;
00051     this->name = rhs.name;
00052     this->description = rhs.description;
00053 
00054     return *this;
00055 }
00056 
00057 
 All Classes Files Functions Variables Typedefs Defines