general indent beautification
This commit is contained in:
@@ -14,31 +14,31 @@ namespace pvAccess {
|
||||
ServerChannelImpl::ServerChannelImpl(Channel::shared_pointer const & channel,
|
||||
pvAccessID cid, pvAccessID sid,
|
||||
ChannelSecuritySession::shared_pointer const & css):
|
||||
_channel(channel),
|
||||
_cid(cid),
|
||||
_sid(sid),
|
||||
_destroyed(false),
|
||||
_channelSecuritySession(css)
|
||||
_channel(channel),
|
||||
_cid(cid),
|
||||
_sid(sid),
|
||||
_destroyed(false),
|
||||
_channelSecuritySession(css)
|
||||
{
|
||||
if (!channel.get())
|
||||
{
|
||||
THROW_BASE_EXCEPTION("non-null channel required");
|
||||
}
|
||||
if (!channel.get())
|
||||
{
|
||||
THROW_BASE_EXCEPTION("non-null channel required");
|
||||
}
|
||||
}
|
||||
|
||||
Channel::shared_pointer ServerChannelImpl::getChannel()
|
||||
{
|
||||
return _channel;
|
||||
return _channel;
|
||||
}
|
||||
|
||||
pvAccessID ServerChannelImpl::getCID() const
|
||||
{
|
||||
return _cid;
|
||||
return _cid;
|
||||
}
|
||||
|
||||
pvAccessID ServerChannelImpl::getSID() const
|
||||
{
|
||||
return _sid;
|
||||
return _sid;
|
||||
}
|
||||
|
||||
ChannelSecuritySession::shared_pointer ServerChannelImpl::getChannelSecuritySession() const
|
||||
@@ -48,39 +48,39 @@ ChannelSecuritySession::shared_pointer ServerChannelImpl::getChannelSecuritySess
|
||||
|
||||
void ServerChannelImpl::registerRequest(const pvAccessID id, Destroyable::shared_pointer const & request)
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
_requests[id] = request;
|
||||
Lock guard(_mutex);
|
||||
_requests[id] = request;
|
||||
}
|
||||
|
||||
void ServerChannelImpl::unregisterRequest(const pvAccessID id)
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
std::map<pvAccessID, epics::pvData::Destroyable::shared_pointer>::iterator iter = _requests.find(id);
|
||||
if(iter != _requests.end())
|
||||
{
|
||||
_requests.erase(iter);
|
||||
}
|
||||
Lock guard(_mutex);
|
||||
std::map<pvAccessID, epics::pvData::Destroyable::shared_pointer>::iterator iter = _requests.find(id);
|
||||
if(iter != _requests.end())
|
||||
{
|
||||
_requests.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
Destroyable::shared_pointer ServerChannelImpl::getRequest(const pvAccessID id)
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
std::map<pvAccessID, epics::pvData::Destroyable::shared_pointer>::iterator iter = _requests.find(id);
|
||||
if(iter != _requests.end())
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
return Destroyable::shared_pointer();
|
||||
Lock guard(_mutex);
|
||||
std::map<pvAccessID, epics::pvData::Destroyable::shared_pointer>::iterator iter = _requests.find(id);
|
||||
if(iter != _requests.end())
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
return Destroyable::shared_pointer();
|
||||
}
|
||||
|
||||
void ServerChannelImpl::destroy()
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
if (_destroyed) return;
|
||||
_destroyed = true;
|
||||
Lock guard(_mutex);
|
||||
if (_destroyed) return;
|
||||
_destroyed = true;
|
||||
|
||||
// destroy all requests
|
||||
destroyAllRequests();
|
||||
// destroy all requests
|
||||
destroyAllRequests();
|
||||
|
||||
// close channel security session
|
||||
// TODO try catch
|
||||
@@ -88,7 +88,7 @@ void ServerChannelImpl::destroy()
|
||||
|
||||
// ... and the channel
|
||||
// TODO try catch
|
||||
_channel->destroy();
|
||||
_channel->destroy();
|
||||
}
|
||||
|
||||
ServerChannelImpl::~ServerChannelImpl()
|
||||
@@ -98,29 +98,29 @@ ServerChannelImpl::~ServerChannelImpl()
|
||||
|
||||
void ServerChannelImpl::printInfo()
|
||||
{
|
||||
printInfo(stdout);
|
||||
printInfo(stdout);
|
||||
}
|
||||
|
||||
void ServerChannelImpl::printInfo(FILE *fd)
|
||||
{
|
||||
fprintf(fd,"CLASS : %s\n", typeid(*this).name());
|
||||
fprintf(fd,"CHANNEL : %s\n", typeid(*_channel).name());
|
||||
fprintf(fd,"CLASS : %s\n", typeid(*this).name());
|
||||
fprintf(fd,"CHANNEL : %s\n", typeid(*_channel).name());
|
||||
}
|
||||
|
||||
void ServerChannelImpl::destroyAllRequests()
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
Lock guard(_mutex);
|
||||
|
||||
// resource allocation optimization
|
||||
if (_requests.size() == 0)
|
||||
return;
|
||||
// resource allocation optimization
|
||||
if (_requests.size() == 0)
|
||||
return;
|
||||
|
||||
while(_requests.size() != 0)
|
||||
{
|
||||
_requests.begin()->second->destroy();
|
||||
}
|
||||
while(_requests.size() != 0)
|
||||
{
|
||||
_requests.begin()->second->destroy();
|
||||
}
|
||||
|
||||
_requests.clear();
|
||||
_requests.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user