mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Fixed some issues with the copy constructors
This commit is contained in:
parent
ef8265a535
commit
e12955a560
@ -616,12 +616,14 @@ private:
|
|||||||
class SerialExecption : public std::exception
|
class SerialExecption : public std::exception
|
||||||
{
|
{
|
||||||
// Disable copy constructors
|
// Disable copy constructors
|
||||||
SerialExecption(const SerialExecption&);
|
|
||||||
void operator=(const SerialExecption&);
|
void operator=(const SerialExecption&);
|
||||||
const SerialExecption& operator=(SerialExecption);
|
const SerialExecption& operator=(SerialExecption);
|
||||||
const char* e_what_;
|
const char* e_what_;
|
||||||
public:
|
public:
|
||||||
SerialExecption (const char *description) : e_what_ (description) {}
|
SerialExecption (const char *description) : e_what_ (description) {}
|
||||||
|
SerialExecption (const SerialExecption& other) {
|
||||||
|
e_what_ = other.e_what_;
|
||||||
|
}
|
||||||
|
|
||||||
virtual const char* what () const throw ()
|
virtual const char* what () const throw ()
|
||||||
{
|
{
|
||||||
@ -634,7 +636,6 @@ public:
|
|||||||
class IOException : public std::exception
|
class IOException : public std::exception
|
||||||
{
|
{
|
||||||
// Disable copy constructors
|
// Disable copy constructors
|
||||||
IOException(const IOException&);
|
|
||||||
void operator=(const IOException&);
|
void operator=(const IOException&);
|
||||||
const IOException& operator=(IOException);
|
const IOException& operator=(IOException);
|
||||||
std::string file_;
|
std::string file_;
|
||||||
@ -647,6 +648,9 @@ public:
|
|||||||
explicit IOException (std::string file, int line, const char * description)
|
explicit IOException (std::string file, int line, const char * description)
|
||||||
: file_(file), line_(line), e_what_ (description), errno_(0) {}
|
: file_(file), line_(line), e_what_ (description), errno_(0) {}
|
||||||
virtual ~IOException() throw() {}
|
virtual ~IOException() throw() {}
|
||||||
|
IOException (const IOException& other) {
|
||||||
|
e_what_ = other.e_what_;
|
||||||
|
}
|
||||||
|
|
||||||
int getErrorNumber () { return errno_; }
|
int getErrorNumber () { return errno_; }
|
||||||
|
|
||||||
@ -665,12 +669,14 @@ public:
|
|||||||
class PortNotOpenedException : public std::exception
|
class PortNotOpenedException : public std::exception
|
||||||
{
|
{
|
||||||
// Disable copy constructors
|
// Disable copy constructors
|
||||||
PortNotOpenedException(const PortNotOpenedException&);
|
|
||||||
void operator=(const PortNotOpenedException&);
|
void operator=(const PortNotOpenedException&);
|
||||||
const PortNotOpenedException& operator=(PortNotOpenedException);
|
const PortNotOpenedException& operator=(PortNotOpenedException);
|
||||||
const char * e_what_;
|
const char * e_what_;
|
||||||
public:
|
public:
|
||||||
PortNotOpenedException (const char * description) : e_what_ (description) {}
|
PortNotOpenedException (const char * description) : e_what_ (description) {}
|
||||||
|
PortNotOpenedException (const PortNotOpenedException& other) {
|
||||||
|
e_what_ = other.e_what_;
|
||||||
|
}
|
||||||
|
|
||||||
virtual const char* what () const throw ()
|
virtual const char* what () const throw ()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user