Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / ace / TMCast / Protocol.hpp
blobd61c26d81736ed9aeed3616931a4c5728ce1c5ed
1 // author : Boris Kolpackov <boris@dre.vanderbilt.edu>
3 #ifndef TMCAST_PROTOCOL_HPP
4 #define TMCAST_PROTOCOL_HPP
6 namespace ACE_TMCast
8 namespace Protocol
10 unsigned long const MEMBER_ID_LENGTH = 38;
12 struct MemberId
14 char id[MEMBER_ID_LENGTH];
16 unsigned long ip;
17 unsigned short port;
21 typedef unsigned short TransactionId;
23 typedef unsigned char TransactionStatus;
25 TransactionStatus const TS_BEGIN = 1;
26 TransactionStatus const TS_COMMIT = 2;
27 TransactionStatus const TS_ABORT = 3;
28 TransactionStatus const TS_COMMITED = 4;
29 TransactionStatus const TS_ABORTED = 5;
31 struct Transaction
33 TransactionId id;
34 TransactionStatus status;
37 // Transaction List (TL)
39 // unsigned long const TL_LENGTH = 1;
41 // typedef Transaction TransactionList[TL_LENGTH];
44 struct MessageHeader
46 unsigned long length;
48 unsigned long check_sum;
50 MemberId member_id;
52 Transaction current;
54 //TransactionList transaction_list;
57 unsigned long const MAX_MESSAGE_SIZE = 768;
59 unsigned long const
60 MAX_PAYLOAD_SIZE = MAX_MESSAGE_SIZE - sizeof (MessageHeader);
62 // Protocol timing
66 unsigned long const SYNC_PERIOD = 30000; // in mks
68 unsigned short const VOTING_FRAME = 4; // in SYNC_PERIOD's
69 unsigned short const SEPARATION_FRAME = 5; // in SYNC_PERIOD's
71 // FATAL_SILENCE_FRAME in SYNC_PERIOD's
72 // Generally it's a good idea to set it to < VOTING_FRAME + SEPARATION_FRAME
75 short const FATAL_SILENCE_FRAME = VOTING_FRAME + SEPARATION_FRAME - 2;
77 // short const FATAL_SILENCE_FRAME = 10000;
79 // Helpers
81 // std::string
82 // tslabel (Protocol::TransactionStatus s);
84 // std::ostream&
85 // operator << (std::ostream& o, Transaction const& t);
89 #endif // TMCAST_PROTOCOL_HPP