diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2007-06-25 21:15:55 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-25 21:15:55 +0000 |
| commit | 3f26c19b0b7a9fa73c58189788972ea43b72f014 (patch) | |
| tree | 8f34928a267fb35becdf939d21187a526f235869 /src/old/programchain.cpp | |
| parent | 2b0fa89df615cb4789668014475ae64d99e773b5 (diff) | |
| download | libbu++-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 'src/old/programchain.cpp')
| -rw-r--r-- | src/old/programchain.cpp | 96 |
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 | |||
| 4 | ProgramChain::ProgramChain() : | ||
| 5 | xLog( MultiLog::getInstance() ) | ||
| 6 | { | ||
| 7 | xLog.LineLog( MultiLog::LStatus, "Program Chain Initialized." ); | ||
| 8 | } | ||
| 9 | |||
| 10 | ProgramChain::~ProgramChain() | ||
| 11 | { | ||
| 12 | } | ||
| 13 | |||
| 14 | bool 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 | |||
| 29 | ProgramLink *ProgramChain::getLink( const char *lpName ) | ||
| 30 | { | ||
| 31 | char a; | ||
| 32 | a = lpName[0]; | ||
| 33 | return NULL; | ||
| 34 | } | ||
| 35 | |||
| 36 | ProgramLink *ProgramChain::getBaseLink() | ||
| 37 | { | ||
| 38 | return NULL; | ||
| 39 | } | ||
| 40 | |||
| 41 | bool 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 | |||
| 57 | bool ProgramChain::enterChainLoop() | ||
| 58 | { | ||
| 59 | for(;;) | ||
| 60 | { | ||
| 61 | if( execChainOnce() == false ) | ||
| 62 | { | ||
| 63 | return false; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | return true; | ||
| 68 | } | ||
| 69 | |||
| 70 | void 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 | |||
| 81 | LinkMessage *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 | } | ||
