Date: Wednesday, February 1, 2006 @ 15:58:58
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/ConnectionParameters.hpp (1.17 -> 1.18)
src/ConnectionParameters.cpp (1.15 -> 1.16)
Rolled back "failure number" field addition: as this was only and internally
used by ControllerConnectPolicy, let's create a new ControllerInfo derived
class in ConnectPolicy and stop having noise everywhere else
Also added copy constructor
----------------------------------+
include/ConnectionParameters.hpp | 11 ++---------
src/ConnectionParameters.cpp | 16 ++++++++--------
2 files changed, 10 insertions(+), 17 deletions(-)
Index: carob/include/ConnectionParameters.hpp
diff -u carob/include/ConnectionParameters.hpp:1.17
carob/include/ConnectionParameters.hpp:1.18
--- carob/include/ConnectionParameters.hpp:1.17 Thu Jan 26 11:50:43 2006
+++ carob/include/ConnectionParameters.hpp Wed Feb 1 15:58:58 2006
@@ -46,6 +46,8 @@
public:
/** Empty constructor to set default values (host="" and port=0) */
ControllerInfo();
+ /** Copy contructor */
+ ControllerInfo(const ControllerInfo& ci);
/** Constructs a Controller info with the given name and port */
ControllerInfo(const std::wstring& host, in_port_t port);
virtual ~ControllerInfo() {}
@@ -62,20 +64,11 @@
* @return sql query as a string
*/
operator std::wstring () const;
- /** Sets the failure number */
- void setFailureNumber(int n) { failure_number = n; }
- /** Gets the failure number */
- int getFailureNumber() const { return failure_number; }
private:
/** String representation of the host name, fully qualified or IP address */
std::wstring host_name;
/** Host port */
in_port_t host_port;
- /**
- * Failure number (since start of process) associated to the last failure of
- * this controller (set and used only by AbstractControllerConnectPolicy)
- */
- int failure_number;
};
/**
Index: carob/src/ConnectionParameters.cpp
diff -u carob/src/ConnectionParameters.cpp:1.15
carob/src/ConnectionParameters.cpp:1.16
--- carob/src/ConnectionParameters.cpp:1.15 Mon Jan 30 12:06:27 2006
+++ carob/src/ConnectionParameters.cpp Wed Feb 1 15:58:58 2006
@@ -31,15 +31,19 @@
ControllerInfo::ControllerInfo() :
host_name(L""),
- host_port(0),
- failure_number(0)
+ host_port(0)
+{
+}
+
+ControllerInfo::ControllerInfo(const ControllerInfo& ci) :
+ host_name(ci.host_name),
+ host_port(ci.host_port)
{
}
ControllerInfo::ControllerInfo(const wstring &name, in_port_t port) :
host_name(name),
- host_port(port),
- failure_number(0)
+ host_port(port)
{
}
@@ -47,13 +51,11 @@
{
host_name = ci.host_name;
host_port = ci.host_port;
- failure_number = ci.failure_number;
return *this;
}
bool ControllerInfo::operator ==(const ControllerInfo& ci) const
{
- //don't compare failure #
return ((host_name == ci.host_name) && (host_port == ci.host_port));
}
@@ -61,8 +63,6 @@
{
std::wostringstream buffer;
buffer<<host_name<<L":"<<host_port;
- if (failure_number>0)
- buffer<<L" controller failure #"<<failure_number;
return buffer.str();
}
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits