GDCM: gdcmNetworkStateID.h Source File

GDCM 3.2.8

gdcmNetworkStateID.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef GDCMNETWORKSTATEID_H
19#define GDCMNETWORKSTATEID_H
20
21namespace gdcm {
22 namespace network {
23
32 enum EStateID {
33 eStaDoesNotExist = 0,
34 eSta1Idle = 1,
35 eSta2Open = 2,
36 eSta3WaitLocalAssoc = 4,
37 eSta4LocalAssocDone = 8,
38 eSta5WaitRemoteAssoc = 16,
39 eSta6TransferReady = 32,
40 eSta7WaitRelease = 64,
41 eSta8WaitLocalRelease = 128,
42 eSta9ReleaseCollisionRqLocal = 256,
43 eSta10ReleaseCollisionAc = 512,
44 eSta11ReleaseCollisionRq = 1024,
45 eSta12ReleaseCollisionAcLocal = 2048,
46 eSta13AwaitingClose = 4096
47 };
48
49 const int cMaxStateID = 13;
50
51 //the transition table is built on state indices
52 //this function will produce the index from the power-of-two EStateID
53 inline int GetStateIndex(EStateID inState){
54 switch (inState){
55 case eStaDoesNotExist:
56 default:
57 return -1;
58 case eSta1Idle:
59 return 0;
60 case eSta2Open:
61 return 1;
62 case eSta3WaitLocalAssoc:
63 return 2;
64 case eSta4LocalAssocDone:
65 return 3;
66 case eSta5WaitRemoteAssoc:
67 return 4;
68 case eSta6TransferReady:
69 return 5;
70 case eSta7WaitRelease:
71 return 6;
72 case eSta8WaitLocalRelease:
73 return 7;
74 case eSta9ReleaseCollisionRqLocal:
75 return 8;
76 case eSta10ReleaseCollisionAc:
77 return 9;
78 case eSta11ReleaseCollisionRq:
79 return 10;
80 case eSta12ReleaseCollisionAcLocal:
81 return 11;
82 case eSta13AwaitingClose:
83 return 12;
84 }
85 }
86 }
87}
88
89#endif //GDCMNETWORKSTATEID_H
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm::network::cMaxStateID
const int cMaxStateID
Definition gdcmNetworkStateID.h:49
gdcm::network::EStateID
EStateID
Definition gdcmNetworkStateID.h:32
gdcm::network::eSta10ReleaseCollisionAc
@ eSta10ReleaseCollisionAc
Definition gdcmNetworkStateID.h:43
gdcm::network::eSta5WaitRemoteAssoc
@ eSta5WaitRemoteAssoc
Definition gdcmNetworkStateID.h:38
gdcm::network::eSta13AwaitingClose
@ eSta13AwaitingClose
Definition gdcmNetworkStateID.h:46
gdcm::network::eSta3WaitLocalAssoc
@ eSta3WaitLocalAssoc
Definition gdcmNetworkStateID.h:36
gdcm::network::eSta4LocalAssocDone
@ eSta4LocalAssocDone
Definition gdcmNetworkStateID.h:37
gdcm::network::eSta1Idle
@ eSta1Idle
Definition gdcmNetworkStateID.h:34
gdcm::network::eSta7WaitRelease
@ eSta7WaitRelease
Definition gdcmNetworkStateID.h:40
gdcm::network::eSta8WaitLocalRelease
@ eSta8WaitLocalRelease
Definition gdcmNetworkStateID.h:41
gdcm::network::eStaDoesNotExist
@ eStaDoesNotExist
Definition gdcmNetworkStateID.h:33
gdcm::network::eSta2Open
@ eSta2Open
Definition gdcmNetworkStateID.h:35
gdcm::network::eSta6TransferReady
@ eSta6TransferReady
Definition gdcmNetworkStateID.h:39
gdcm::network::eSta11ReleaseCollisionRq
@ eSta11ReleaseCollisionRq
Definition gdcmNetworkStateID.h:44
gdcm::network::eSta12ReleaseCollisionAcLocal
@ eSta12ReleaseCollisionAcLocal
Definition gdcmNetworkStateID.h:45
gdcm::network::eSta9ReleaseCollisionRqLocal
@ eSta9ReleaseCollisionRqLocal
Definition gdcmNetworkStateID.h:42
gdcm::network::GetStateIndex
int GetStateIndex(EStateID inState)
Definition gdcmNetworkStateID.h:53
gdcm
Definition gdcmASN1.h:21