aboutsummaryrefslogtreecommitdiff
path: root/src/old/programchain.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-25 21:15:55 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-25 21:15:55 +0000
commit3f26c19b0b7a9fa73c58189788972ea43b72f014 (patch)
tree8f34928a267fb35becdf939d21187a526f235869 /src/old/programchain.cpp
parent2b0fa89df615cb4789668014475ae64d99e773b5 (diff)
downloadlibbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.gz
libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.bz2
libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.xz
libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.zip
I think the plugger and programchain are all up to date to work with the new
libbu++. The program chain may undergo heavy changes still, or be removed entirely, but we need it for congo and squirrelmud, so here it is for a while longer. The TafWriter isn't much closer, you still only get the groups in the output.
Diffstat (limited to '')
-rw-r--r--src/old/programchain.cpp96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/old/programchain.cpp b/src/old/programchain.cpp
deleted file mode 100644
index 6120d58..0000000
--- a/src/old/programchain.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
1#include <stdlib.h>
2#include "programchain.h"
3
4ProgramChain::ProgramChain() :
5 xLog( MultiLog::getInstance() )
6{
7 xLog.LineLog( MultiLog::LStatus, "Program Chain Initialized." );
8}
9
10ProgramChain::~ProgramChain()
11{
12}
13
14bool ProgramChain::addLink( ProgramLink *pLink )
15{
16 if( pLink->init() == false )
17 {
18 emergencyShutdown();
19 return false;
20 }
21
22 lLink.append( pLink );
23
24 pLink->setChain( this );
25
26 return true;
27}
28
29ProgramLink *ProgramChain::getLink( const char *lpName )
30{
31 char a;
32 a = lpName[0];
33 return NULL;
34}
35
36ProgramLink *ProgramChain::getBaseLink()
37{
38 return NULL;
39}
40
41bool ProgramChain::execChainOnce()
42{
43 int nLen = lLink.getSize();
44 for( int j = 0; j < nLen; j++ )
45 {
46 if( ((ProgramLink *)lLink[j])->timeSlice() == false )
47 {
48 xLog.LineLog( MultiLog::LInfo, "Shutting down due to signal from link #%d", j );
49 emergencyShutdown();
50 return false;
51 }
52 }
53
54 return true;
55}
56
57bool ProgramChain::enterChainLoop()
58{
59 for(;;)
60 {
61 if( execChainOnce() == false )
62 {
63 return false;
64 }
65 }
66
67 return true;
68}
69
70void ProgramChain::emergencyShutdown()
71{
72 int nLen = lLink.getSize();
73 for( int j = 0; j < nLen; j++ )
74 {
75 ((ProgramLink *)lLink[j])->deInit();
76 delete (ProgramLink *)lLink[j];
77 }
78 lLink.empty();
79}
80
81LinkMessage *ProgramChain::broadcastIRM( LinkMessage *pMsgOut, ProgramLink *pSender )
82{
83 int nLen = lLink.getSize();
84 for( int j = 0; j < nLen; j++ )
85 {
86 LinkMessage *pMsg = ((ProgramLink *)lLink[j])->processIRM( pMsgOut );
87 if( pMsg != NULL )
88 {
89 delete pMsgOut;
90 return pMsg;
91 }
92 }
93
94 delete pMsgOut;
95 return NULL;
96}