44 if (!fAllowedField.empty() && (fAllowedField==name)) {
45 fAllowedField.clear();
49 if ((name ==
"state") && (fAllowedField==
"%%state%%")) {
50 fAllowedField.clear();
55 if (fConnState == sInit)
return true;
68 case sInit:
return "Init";
69 case sPending:
return "Pending";
70 case sConnecting:
return "Connecting";
71 case sConnected:
return "Connected";
72 case sDisconnected:
return "Disconnected";
73 case sBroken:
return "Broken";
74 case sFailed:
return "Failed";
91 if (fConnState==state)
return;
95 if ((state==sPending) && (fConnState!=sInit))
return;
100 signal = (state!=sInit);
102 if (signal) fAllowedField =
"%%state%%";
105 DOUT3(
"Change connection state to %s", GetStateName(state));
108 SetField(
"", GetStateName(state));
115 if (GetObject()) GetObject()->ChangeState(state, force);
123 if (GetObject()) GetObject()->fAllowedField = name;
129 if ((node==0) ||
null())
return;
134 SetConnThread(thrdname);
145 SetAllowedField(
"server");
156 if (poolname!=0) SetPoolName(poolname);
161 SetConnDevice(devname);
165 double tmout_val(10.);
168 SetConnTimeout(tmout_val);
void ChangeState(EState state, bool force)
Change state of connection object.
ConnectionObject::EState GetState()
virtual std::string DefaultFiledName() const
ConnectionObject(Reference port, const std::string &localurl)
virtual bool _CanChangeField(const std::string &)
Reimplement virtual method of ParameterContainer to block field change if object in non-init state.
static const char * GetStateName(EState state)
virtual ~ConnectionObject()
void SetConfigFromXml(XMLNodePointer_t node)
void ChangeState(ConnectionObject::EState state, bool force)
void SetAllowedField(const std::string &name="")
Lock guard for posix mutex.
Container for parameter object.
void SetSynchron(bool on, double interval=1., bool everyevnt=false)
Specifies that parameter produce 'modified' events synchronous with changes of parameter.
Reference on the arbitrary object
const char * GetAttr(XMLNodePointer_t xmlnode, const char *name)
const char * xmlTimeoutAttr
const char * xmlUseacknAttr
bool str_to_double(const char *val, double *res)
Convert string to double value.
const char * xmlDeviceAttr
const char * xmlOptionalAttr
const char * xmlThreadAttr
const char * xmlTrueValue