1010* and is not subject to copyright.
1111*/
1212
13- /* $Id: cmdmgr.cc,v 3.0.1.2 1997/11/05 22:11:41 sauderd DP3.1 $ */
14-
1513#include < cmdmgr.h>
1614
1715
@@ -27,61 +25,45 @@ ReplicateLinkNode * ReplicateList::FindNode( MgrNode * mn ) {
2725 return 0 ;
2826}
2927
30- BOOLEAN ReplicateList::IsOnList ( MgrNode * mn ) {
28+ bool ReplicateList::IsOnList ( MgrNode * mn ) {
3129 return ( FindNode ( mn ) != 0 );
32- /*
33- ReplicateLinkNode *rln = (ReplicateLinkNode *)GetHead();
34- int numEntries = EntryCount();
35- int found = 0;
36- while(numEntries--)
37- {
38- if(rln->ReplicateNode() == mn)
39- {
40- found = 1;
41- numEntries = 0;
42- }
43- rln = (ReplicateLinkNode *)rln->NextNode();
44- }
45- return found;
46- */
4730}
4831
4932// /////////////////////////////////////////////////////////////////////////////
5033// returns true if it could delete the node
5134// /////////////////////////////////////////////////////////////////////////////
52- BOOLEAN ReplicateList::Remove ( ReplicateLinkNode * rln ) {
35+ bool ReplicateList::Remove ( ReplicateLinkNode * rln ) {
5336 ReplicateLinkNode * rnFollow = ( ReplicateLinkNode * )GetHead ();
5437 if ( !rnFollow || !rln ) {
55- return 0 ;
38+ return false ;
5639 } else {
5740 if ( rnFollow == rln ) {
5841 head = rln->NextNode ();
5942 delete rln;
60- return 1 ;
43+ return true ;
6144 } else {
6245 ReplicateLinkNode * rn = ( ReplicateLinkNode * )rnFollow->NextNode ();
6346 while ( rn ) {
6447 if ( rn == rln ) {
6548 rnFollow->next = ( SingleLinkNode * )rln->NextNode ();
6649 delete rln;
67- return 1 ;
50+ return true ;
6851 }
6952 rnFollow = rn;
7053 rn = ( ReplicateLinkNode * )rn->NextNode ();
7154 } // end while(rn)
7255 } // end else
7356 } // end else
74- return 0 ;
57+ return false ;
7558}
7659
77- BOOLEAN ReplicateList::Remove ( MgrNode * rn ) {
60+ bool ReplicateList::Remove ( MgrNode * rn ) {
7861 return Remove ( FindNode ( rn ) );
7962}
8063
8164CmdMgr::CmdMgr () {
8265 completeList = new MgrNodeList ( completeSE );
8366 incompleteList = new MgrNodeList ( incompleteSE );
84- // newList = new MgrNodeList(newSE);
8567 deleteList = new MgrNodeList ( deleteSE );
8668
8769 mappedWriteList = new DisplayNodeList ( mappedWrite );
@@ -90,40 +72,21 @@ CmdMgr::CmdMgr() {
9072 replicateList = new ReplicateList ();
9173}
9274
93- int CmdMgr::ReplicateCmdList ( MgrNode * mn ) {
75+ void CmdMgr::ReplicateCmdList ( MgrNode * mn ) {
9476 if ( !( replicateList->IsOnList ( mn ) ) ) {
9577 replicateList->AddNode ( mn );
9678 }
97- return 1 ;
98- }
99-
100- /*
101- void CmdMgr::ModifyCmdList(MgrNode *mn)
102- {
103- mn->ChangeList(mappedWriteList);
104- }
105-
106- void CmdMgr::ViewCmdList(MgrNode *mn)
107- {
108- mn->ChangeList(mappedViewList);
10979}
11080
111- void CmdMgr::CloseCmdList(MgrNode *mn)
112- {
113- mn->ChangeList(closeList);
114- }
115- */
116-
11781void CmdMgr::ClearInstances () {
11882 completeList->ClearEntries ();
11983 incompleteList->ClearEntries ();
12084 cancelList->ClearEntries ();
12185 deleteList->ClearEntries ();
12286 replicateList->Empty ();
12387
124- // newList->ClearEntries();
12588}
126- // searches current list for fileId
89+ // / searches current list for fileId
12790MgrNode * CmdMgr::StateFindFileId ( stateEnum s, int fileId ) {
12891 switch ( s ) {
12992 case completeSE:
0 commit comments