00001 #include "IONameIS.h"
00002 #include "../SctNames.h"
00003
00004 namespace Sct {
00005 namespace IS {
00006
00007 string IONameIS::defaultServer = SctNames::getEventDataName();
00008
00009 IONameIS::IONameIS(const string& nameIO) throw(InvalidArgument) : IOName(nameIO) {
00010 IONameIS::parse();
00011 }
00012
00013 IONameIS::IONameIS() {
00014 }
00015
00016
00017 IONameIS::IONameIS(const string& uniqueID, const string& className) throw() : IOName(uniqueID, className), server(defaultServer) {
00018 IONameIS::construct();
00019 }
00020
00021 IONameIS::IONameIS(const string& uniqueID, const string& className, const string& server) throw() : IOName(uniqueID, className), server(server) {
00022 IONameIS::construct();
00023 }
00024
00025 IONameIS::~IONameIS() throw() {
00026 }
00027
00028
00029 string IONameIS::getRegExp(const string& className) throw() {
00030 string regExp = ".*";
00031 regExp += className;
00032 regExp += ".*";
00033 return regExp;
00034 }
00035
00036 void IONameIS::parse() throw(InvalidArgument) {
00037 int dot = nameIO.find('.');
00038 server = nameIO.substr(0, dot);
00039 int dot2 = nameIO.find('.', ++dot);
00040 className = nameIO.substr(dot, dot2-dot);
00041 uniqueID = nameIO.substr(++dot2);
00042 }
00043
00044 void IONameIS::construct() throw() {
00045 nameIO = server;
00046 nameIO += ".";
00047 nameIO += className;
00048 nameIO += ".";
00049 nameIO += uniqueID;
00050 }
00051
00052 void IONameIS::setServer(const string& server) throw() {
00053 this->server = server;
00054 construct();
00055 }
00056
00057 string IONameIS::getServer() const throw() {
00058 return server;
00059 }
00060
00061 string IONameIS::getDefaultServer() throw() {
00062 return defaultServer;
00063 }
00064
00065 void IONameIS::setDefaultServer(const string& server) throw() {
00066 defaultServer = server;
00067 }
00068 }
00069 }