fixed version reporting (shows module version) now; fixed system configuration and startPVAServer user specified provider name(s)

This commit is contained in:
Matej Sekoranja
2013-09-02 23:17:52 +02:00
parent 5fdfaa21d0
commit 1dbf736ad2
5 changed files with 57 additions and 8 deletions

View File

@@ -10,6 +10,13 @@
#include <pv/pvType.h>
#include <pv/noDefaultMethods.h>
// module version
// TODO to be generated, etc.
#define EPICS_PVA_MAJOR_VERSION 3
#define EPICS_PVA_MINOR_VERSION 0
#define EPICS_PVA_MAINTENANCE_VERSION 1
#define EPICS_PVA_DEVELOPMENT_FLAG 0
namespace epics {
namespace pvAccess {

View File

@@ -3991,7 +3991,11 @@ namespace epics {
m_addressList(""), m_autoAddressList(true), m_connectionTimeout(30.0f), m_beaconPeriod(15.0f),
m_broadcastPort(PVA_BROADCAST_PORT), m_receiveBufferSize(MAX_TCP_RECV),
m_namedLocker(), m_lastCID(0), m_lastIOID(0),
m_version("pvAccess Client", "cpp", 4, 3, 0, false),
m_version("pvAccess Client", "cpp",
EPICS_PVA_MAJOR_VERSION,
EPICS_PVA_MINOR_VERSION,
EPICS_PVA_MAINTENANCE_VERSION,
EPICS_PVA_DEVELOPMENT_FLAG),
m_contextState(CONTEXT_NOT_INITIALIZED),
m_configuration(new SystemConfigurationImpl()),
m_flushStrategy(DELAYED)

View File

@@ -651,6 +651,11 @@ void ServerChannelGetRequesterImpl::getDone(const Status& status)
void ServerChannelGetRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -874,6 +879,11 @@ void ServerChannelPutRequesterImpl::unlock()
void ServerChannelPutRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -1097,6 +1107,11 @@ void ServerChannelPutGetRequesterImpl::unlock()
void ServerChannelPutGetRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -1317,6 +1332,11 @@ void ServerMonitorRequesterImpl::unlock()
void ServerMonitorRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -1550,6 +1570,11 @@ void ServerChannelArrayRequesterImpl::unlock()
void ServerChannelArrayRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -1766,6 +1791,11 @@ void ServerChannelProcessRequesterImpl::unlock()
void ServerChannelProcessRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);
@@ -1880,7 +1910,8 @@ void ServerGetFieldRequesterImpl::send(ByteBuffer* buffer, TransportSendControl*
{
Lock guard(_mutex);
_status.serialize(buffer, control);
control->cachedSerialize(_field, buffer);
if (_status.isSuccess())
control->cachedSerialize(_field, buffer);
}
}
@@ -2009,6 +2040,11 @@ void ServerChannelRPCRequesterImpl::unlock()
void ServerChannelRPCRequesterImpl::destroy()
{
// keep a reference to ourselves as the owner
// could release its reference and we don't want to be
// destroyed prematurely
shared_pointer self(shared_from_this());
{
Lock guard(_mutex);
_channel->unregisterRequest(_ioid);

View File

@@ -18,7 +18,8 @@ using std::tr1::static_pointer_cast;
namespace epics { namespace pvAccess {
const char* ServerContextImpl::StateNames[] = { "NOT_INITIALIZED", "INITIALIZED", "RUNNING", "SHUTDOWN", "DESTROYED"};
const Version ServerContextImpl::VERSION("pvAccess Server", "cpp", 4, 3, 0, false);
const Version ServerContextImpl::VERSION("pvAccess Server", "cpp",
EPICS_PVA_MAJOR_VERSION, EPICS_PVA_MINOR_VERSION, EPICS_PVA_MAINTENANCE_VERSION, EPICS_PVA_DEVELOPMENT_FLAG);
ServerContextImpl::ServerContextImpl():
_state(NOT_INITIALIZED),
@@ -616,9 +617,9 @@ ServerContext::shared_pointer startPVAServer(String const & providerNames, int t
ServerContextImpl::shared_pointer ctx = ServerContextImpl::create();
// do not override configuration
if (providerNames == PVACCESS_ALL_PROVIDERS && !ctx->isChannelProviderNamePreconfigured())
if (!ctx->isChannelProviderNamePreconfigured())
ctx->setChannelProviderName(providerNames);
ChannelAccess::shared_pointer channelAccess = getChannelAccess();
ctx->initialize(channelAccess);

View File

@@ -76,7 +76,6 @@ string Properties::getProperty(const string &key, const string &defaultValue)
return string(propertiesIterator->second);
}
_properties[key] = defaultValue;
return defaultValue;
}
@@ -335,12 +334,14 @@ string SystemConfigurationImpl::getPropertyAsString(const string &name, const st
{
return _properties->getProperty(name, string(val));
}
return _properties->getProperty(name,defaultValue);
return _properties->getProperty(name, defaultValue);
}
bool SystemConfigurationImpl::hasProperty(const string &key)
{
return _properties->hasProperty(key);
strncpy(_envParam.name,key.c_str(),key.length() + 1);
const char* val = envGetConfigParamPtr(&_envParam);
return (val != NULL) || _properties->hasProperty(key);
}
ConfigurationProviderImpl::ConfigurationProviderImpl()