String -> std::string, toString methods removed

This commit is contained in:
Matej Sekoranja
2014-06-19 14:27:48 +02:00
parent 6ec207141f
commit c6eed12139
82 changed files with 1606 additions and 1651 deletions
+8 -6
View File
@@ -17,12 +17,14 @@
#include <pv/pvData.h>
#include <pv/alarm.h>
using std::string;
namespace epics { namespace pvData {
AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
{
if(value<0 || value>4) {
throw std::logic_error(String("getSeverity value is illegal"));
throw std::logic_error(string("getSeverity value is illegal"));
}
switch (value) {
case 0: return noAlarm;
@@ -31,7 +33,7 @@ AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
case 3: return invalidAlarm;
case 4: return undefinedAlarm;
}
throw std::logic_error(String("should never get here"));
throw std::logic_error(string("should never get here"));
}
StringArrayPtr AlarmSeverityFunc::getSeverityNames()
@@ -61,13 +63,13 @@ AlarmSeverity Alarm::getSeverity() const
case 3: return invalidAlarm;
case 4: return undefinedAlarm;
}
throw std::logic_error(String("should never get here"));
throw std::logic_error(string("should never get here"));
}
AlarmStatus AlarmStatusFunc::getStatus(int value)
{
if(value<0 || value>7) {
throw std::logic_error(String("getStatus value is illegal"));
throw std::logic_error(string("getStatus value is illegal"));
}
switch (value) {
case 0: return noStatus;
@@ -79,7 +81,7 @@ AlarmStatus AlarmStatusFunc::getStatus(int value)
case 6: return undefinedStatus;
case 7: return clientStatus;
}
throw std::logic_error(String("should never get here"));
throw std::logic_error(string("should never get here"));
}
StringArrayPtr AlarmStatusFunc::getStatusNames()
@@ -115,7 +117,7 @@ AlarmStatus Alarm::getStatus() const
case 6: return undefinedStatus;
case 7: return clientStatus;
}
throw std::logic_error(String("should never get here"));
throw std::logic_error(string("should never get here"));
}
}}
+4 -4
View File
@@ -42,10 +42,10 @@ public:
class epicsShareClass Alarm {
public:
Alarm() : severity(0),status(0), message(String("")) {}
Alarm() : severity(0),status(0), message(std::string("")) {}
//default constructors and destructor are OK
String getMessage() const {return message;}
void setMessage(String const &value) {message = value;}
std::string getMessage() const {return message;}
void setMessage(std::string const &value) {message = value;}
AlarmSeverity getSeverity() const;
void setSeverity(AlarmSeverity value) {severity = value;}
AlarmStatus getStatus() const;
@@ -53,7 +53,7 @@ public:
private:
int32 severity;
int32 status;
String message;
std::string message;
};
}}
+10 -10
View File
@@ -22,23 +22,23 @@ namespace epics { namespace pvData {
class epicsShareClass Display {
public:
Display()
: description(String("")),format(String("")),units(String("")),
: description(std::string("")),format(std::string("")),units(std::string("")),
low(0.0),high(0.0) {}
//default constructors and destructor are OK
double getLow() const {return low;}
double getHigh() const{ return high;}
void setLow(double value){low = value;}
void setHigh(double value){high = value;}
String getDescription() const {return description;}
void setDescription(String const & value) {description = value;}
String getFormat() const {return format;}
void setFormat(String const & value) {format = value;}
String getUnits() const {return units;}
void setUnits(String const & value) {units = value;}
std::string getDescription() const {return description;}
void setDescription(std::string const & value) {description = value;}
std::string getFormat() const {return format;}
void setFormat(std::string const & value) {format = value;}
std::string getUnits() const {return units;}
void setUnits(std::string const & value) {units = value;}
private:
String description;
String format;
String units;
std::string description;
std::string format;
std::string units;
double low;
double high;
};
+5 -4
View File
@@ -16,12 +16,13 @@
#include <pv/pvData.h>
#include <pv/pvAlarm.h>
using std::tr1::static_pointer_cast;
using std::string;
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
String PVAlarm::noAlarmFound("No alarm structure found");
String PVAlarm::notAttached("Not attached to an alarm structure");
string PVAlarm::noAlarmFound("No alarm structure found");
string PVAlarm::notAttached("Not attached to an alarm structure");
bool PVAlarm::attach(PVFieldPtr const & pvField)
{
+2 -2
View File
@@ -37,8 +37,8 @@ private:
PVIntPtr pvSeverity;
PVIntPtr pvStatus;
PVStringPtr pvMessage;
static String noAlarmFound;
static String notAttached;
static std::string noAlarmFound;
static std::string notAttached;
};
}}
+4 -3
View File
@@ -19,9 +19,10 @@
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
using std::string;
String PVControl::noControlFound("No control structure found");
String PVControl::notAttached("Not attached to an control structure");
string PVControl::noControlFound("No control structure found");
string PVControl::notAttached("Not attached to an control structure");
bool PVControl::attach(PVFieldPtr const & pvField)
{
@@ -29,7 +30,7 @@ bool PVControl::attach(PVFieldPtr const & pvField)
PVStructurePtr pvStructure = static_pointer_cast<PVStructure>(pvField);
pvLow = pvStructure->getDoubleField("limitLow");
if(pvLow.get()==NULL) return false;
pvHigh = pvStructure->getDoubleField(String("limitHigh"));
pvHigh = pvStructure->getDoubleField(string("limitHigh"));
if(pvHigh.get()==NULL) {
pvLow.reset();
return false;
+2 -2
View File
@@ -33,8 +33,8 @@ public:
private:
PVDoublePtr pvLow;
PVDoublePtr pvHigh;
static String noControlFound;
static String notAttached;
static std::string noControlFound;
static std::string notAttached;
};
}}
+7 -6
View File
@@ -16,12 +16,13 @@
#include <pv/pvData.h>
#include <pv/pvDisplay.h>
using std::tr1::static_pointer_cast;
using std::string;
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
String PVDisplay::noDisplayFound("No display structure found");
String PVDisplay::notAttached("Not attached to an display structure");
string PVDisplay::noDisplayFound("No display structure found");
string PVDisplay::notAttached("Not attached to an display structure");
bool PVDisplay::attach(PVFieldPtr const & pvField)
{
@@ -39,12 +40,12 @@ bool PVDisplay::attach(PVFieldPtr const & pvField)
detach();
return false;
}
pvLow = pvStructure->getDoubleField(String("limitLow"));
pvLow = pvStructure->getDoubleField(string("limitLow"));
if(pvLow.get()==NULL) {
detach();
return false;
}
pvHigh = pvStructure->getDoubleField(String("limitHigh"));
pvHigh = pvStructure->getDoubleField(string("limitHigh"));
if(pvHigh.get()==NULL) {
detach();
return false;
+2 -2
View File
@@ -33,8 +33,8 @@ public:
void get(Display &) const;
bool set(Display const & display);
private:
static String noDisplayFound;
static String notAttached;
static std::string noDisplayFound;
static std::string notAttached;
PVStringPtr pvDescription;
PVStringPtr pvFormat;
PVStringPtr pvUnits;
+6 -5
View File
@@ -16,12 +16,13 @@
#include <pv/pvData.h>
#include <pv/pvEnumerated.h>
using std::tr1::static_pointer_cast;
using std::string;
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
String PVEnumerated::notFound("No enumerated structure found");
String PVEnumerated::notAttached("Not attached to an enumerated structure");
string PVEnumerated::notFound("No enumerated structure found");
string PVEnumerated::notAttached("Not attached to an enumerated structure");
bool PVEnumerated::attach(PVFieldPtr const & pvField)
{
@@ -68,7 +69,7 @@ int32 PVEnumerated::getIndex()
return pvIndex->get();
}
String PVEnumerated::getChoice()
string PVEnumerated::getChoice()
{
if(pvIndex.get()==NULL ) {
throw std::logic_error(notAttached);
+3 -3
View File
@@ -33,14 +33,14 @@ public:
// a set returns false if field is immutable
bool setIndex(int32 index);
int32 getIndex();
String getChoice();
std::string getChoice();
bool choicesMutable();
inline PVStringArray::const_svector getChoices(){return pvChoices->view();}
int32 getNumberChoices();
bool setChoices(const StringArray & choices);
private:
static String notFound;
static String notAttached;
static std::string notFound;
static std::string notAttached;
PVIntPtr pvIndex;
PVStringArrayPtr pvChoices;
};
+5 -4
View File
@@ -16,12 +16,13 @@
#include <pv/pvData.h>
#include <pv/pvTimeStamp.h>
using std::tr1::static_pointer_cast;
using std::string;
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
String PVTimeStamp::noTimeStamp("No timeStamp structure found");
String PVTimeStamp::notAttached("Not attached to a timeStamp structure");
string PVTimeStamp::noTimeStamp("No timeStamp structure found");
string PVTimeStamp::notAttached("Not attached to a timeStamp structure");
bool PVTimeStamp::attach(PVFieldPtr const & pvField)
{
+2 -2
View File
@@ -36,8 +36,8 @@ public:
void get(TimeStamp &) const;
bool set(TimeStamp const & timeStamp);
private:
static String noTimeStamp;
static String notAttached;
static std::string noTimeStamp;
static std::string notAttached;
PVLongPtr pvSecs;
PVIntPtr pvUserTag;
PVIntPtr pvNano;