gdcmULConnection.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef GDCMULCONNECTION_H
#define GDCMULCONNECTION_H
#include "gdcmNetworkStateID.h"
#include "gdcmARTIMTimer.h"
#include "gdcmULConnectionInfo.h"
#include "gdcmPresentationContextRQ.h"
#include "gdcmDataElement.h"
#include "gdcmPresentationContextAC.h"
#include "gdcmPresentationContext.h"
class iosockinet;
class echo;
namespace gdcm{
namespace network{
class GDCM_EXPORT ULConnection
{
ULConnectionInfo mInfo;
//this is a dirty dirty hack
//but to establish an outgoing connection (scu), we need the echo service
//to establish incoming, we just need a port and localhost, so an iosockinet works while an
//echo would fail (probably because one already exists)
echo* mEcho;
iosockinet* mSocket;//of the three protocols offered by socket++-- echo, smtp, and ftp--
//echo most closely matches what the DICOM standard describes as a network connection
ARTIMTimer mTimer;
EStateID mCurrentState;
std::vector<PresentationContextRQ> mPresentationContexts;
//this is our list of presentation contexts of what we can send
uint32_t mMaxPDUSize;
std::vector<PresentationContextAC> mAcceptedPresentationContexts;//these come back from the server
//and tell us what can be sent over this connection
TransferSyntaxSub cstorets;
friend class ULActionAE6;
void SetCStoreTransferSyntax( TransferSyntaxSub const & ts );
friend class ULConnectionManager;
TransferSyntaxSub const & GetCStoreTransferSyntax( ) const;
public:
ULConnection(const ULConnectionInfo& inUserInformation);
//destructors are virtual to prevent memory leaks by inherited classes
virtual ~ULConnection();
EStateID GetState() const;
void SetState(const EStateID& inState);//must be able to update state...
//echo* GetProtocol();
std::iostream* GetProtocol();
void StopProtocol();
ARTIMTimer& GetTimer();
const ULConnectionInfo &GetConnectionInfo() const;
//when the connection is first associated, the connection is told
//the max packet/PDU size and the way in which to present data
//(presentation contexts, etc). Store that here.
void SetMaxPDUSize(uint32_t inSize);
uint32_t GetMaxPDUSize() const;
const PresentationContextAC *GetPresentationContextACByID(uint8_t id) const;
const PresentationContextRQ *GetPresentationContextRQByID(uint8_t id) const;
uint8_t GetPresentationContextIDFromPresentationContext(PresentationContextRQ const & pc) const;
std::vector<PresentationContextRQ> const & GetPresentationContexts() const;
void SetPresentationContexts(const std::vector<PresentationContextRQ>& inContexts);
void SetPresentationContexts(const std::vector<PresentationContext>& inContexts);
//given a particular data element, presumably the SOP class,
//find the presentation context for that SOP
//NOT YET IMPLEMENTED
PresentationContextRQ FindContext(const DataElement& de) const;
std::vector<PresentationContextAC> const & GetAcceptedPresentationContexts() const;
std::vector<PresentationContextAC> & GetAcceptedPresentationContexts();
void AddAcceptedPresentationContext(const PresentationContextAC& inPC);
bool InitializeConnection();
bool InitializeIncomingConnection();
ULConnection(const ULConnection&) = delete;
void operator=(const ULConnection&) = delete;
};
}
}
#endif // ULCONNECTION_H
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::network::ARTIMTimer
ARTIMTimer.
Definition gdcmARTIMTimer.h:39
gdcm::network::PresentationContextAC
PresentationContextAC.
Definition gdcmPresentationContextAC.h:33
gdcm::network::PresentationContextRQ
PresentationContextRQ.
Definition gdcmPresentationContextRQ.h:35
gdcm::network::TransferSyntaxSub
TransferSyntaxSub.
Definition gdcmTransferSyntaxSub.h:38
gdcm::network::ULConnectionInfo
ULConnectionInfo.
Definition gdcmULConnectionInfo.h:38
gdcm::network::ULConnection::ULActionAE6
friend class ULActionAE6
Definition gdcmULConnection.h:80
gdcm::network::ULConnection::FindContext
PresentationContextRQ FindContext(const DataElement &de) const
gdcm::network::ULConnection::GetState
EStateID GetState() const
gdcm::network::ULConnection::GetAcceptedPresentationContexts
std::vector< PresentationContextAC > & GetAcceptedPresentationContexts()
gdcm::network::ULConnection::SetPresentationContexts
void SetPresentationContexts(const std::vector< PresentationContextRQ > &inContexts)
gdcm::network::ULConnection::GetTimer
ARTIMTimer & GetTimer()
gdcm::network::ULConnection::InitializeIncomingConnection
bool InitializeIncomingConnection()
used to establish scp connections
gdcm::network::ULConnection::GetAcceptedPresentationContexts
std::vector< PresentationContextAC > const & GetAcceptedPresentationContexts() const
gdcm::network::ULConnection::GetMaxPDUSize
uint32_t GetMaxPDUSize() const
gdcm::network::ULConnection::GetPresentationContextRQByID
const PresentationContextRQ * GetPresentationContextRQByID(uint8_t id) const
gdcm::network::ULConnection::GetPresentationContexts
std::vector< PresentationContextRQ > const & GetPresentationContexts() const
gdcm::network::ULConnection::AddAcceptedPresentationContext
void AddAcceptedPresentationContext(const PresentationContextAC &inPC)
gdcm::network::ULConnection::ULConnection
ULConnection(const ULConnectionInfo &inUserInformation)
gdcm::network::ULConnection::GetProtocol
std::iostream * GetProtocol()
gdcm::network::ULConnection::SetState
void SetState(const EStateID &inState)
gdcm::network::ULConnection::SetMaxPDUSize
void SetMaxPDUSize(uint32_t inSize)
gdcm::network::ULConnection::ULConnection
ULConnection(const ULConnection &)=delete
gdcm::network::ULConnection::GetPresentationContextACByID
const PresentationContextAC * GetPresentationContextACByID(uint8_t id) const
gdcm::network::ULConnection::~ULConnection
virtual ~ULConnection()
gdcm::network::ULConnection::SetPresentationContexts
void SetPresentationContexts(const std::vector< PresentationContext > &inContexts)
gdcm::network::ULConnection::StopProtocol
void StopProtocol()
gdcm::network::ULConnection::GetConnectionInfo
const ULConnectionInfo & GetConnectionInfo() const
gdcm::network::ULConnection::ULConnectionManager
friend class ULConnectionManager
Definition gdcmULConnection.h:82
gdcm::network::ULConnection::operator=
void operator=(const ULConnection &)=delete
gdcm::network::ULConnection::GetPresentationContextIDFromPresentationContext
uint8_t GetPresentationContextIDFromPresentationContext(PresentationContextRQ const &pc) const
return 0 upon error
gdcm::network::ULConnection::InitializeConnection
bool InitializeConnection()
used to establish scu connections
gdcmARTIMTimer.h
gdcmDataElement.h
gdcmNetworkStateID.h
gdcmPresentationContextAC.h
gdcmPresentationContextRQ.h
gdcmPresentationContext.h
gdcmULConnectionInfo.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm::network::EStateID
EStateID
Definition gdcmNetworkStateID.h:32
gdcm
Definition gdcmASN1.h:21