Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PointerControlBlock.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // PointerControlBlock.cpp 00005 // 00006 // Version 1.1 00007 // Date 15.10.03 (Version 1.0) 00008 // 16.10.03 (Version 1.1) 00009 // Author R. Totaro 00010 // 00011 // Change Record: 00012 // Version 1.1: Fixed the behaviour of isObjectConfigured() 00013 00014 #include "../GeneralInclude/CompilerSwitches.h" 00015 #include "../GeneralInclude/DebugSupport.h" 00016 #include "../GeneralInclude/Constants.h" 00017 #include "../Base/CC_RootObject.h" 00018 #include "PointerControlBlock.h" 00019 00020 PointerControlBlock::PointerControlBlock(void) { 00021 pU=pNULL; 00022 pY=pNULL; 00023 } 00024 00025 void PointerControlBlock::setNumberOfInputs(unsigned int n) { 00026 assert(nInputs<0); 00027 assert(n>0); 00028 00029 nInputs=n; 00030 pU=new TD_Float*[n]; 00031 for (unsigned int i=0;i<n;i++) 00032 pU[i]=pNULL; 00033 } 00034 00035 void PointerControlBlock::setNumberOfOutputs(unsigned int n) { 00036 assert(nOutputs<0); 00037 assert(n>0); 00038 00039 nOutputs=n; 00040 pY=new TD_Float*[n]; 00041 for (unsigned int i=0;i<n;i++) 00042 pY[i]=pNULL; 00043 } 00044 00045 void PointerControlBlock::setInputLink(unsigned int i,TD_Float *pInput) { 00046 assert(pU!=pNULL && pInput!=pNULL && (int)i<nInputs); 00047 00048 if ((int)i<nInputs) 00049 pU[i]=pInput; 00050 else 00051 CC_RootObject::getEventRepository()->create(this,EVT_ILLEGAL_CB); 00052 } 00053 00054 void PointerControlBlock::setOutputLink(unsigned int i,TD_Float *pOutput) { 00055 assert(pY!=pNULL && pOutput!=pNULL && (int)i<nOutputs); 00056 00057 if ((int)i<nOutputs) 00058 pY[i]=pOutput; 00059 else 00060 CC_RootObject::getEventRepository()->create(this,EVT_ILLEGAL_CB); 00061 } 00062 00063 bool PointerControlBlock::isObjectConfigured(void) { 00064 if (!ControlBlock::isObjectConfigured()) 00065 return false; 00066 00067 for (int i=0;i<nInputs;i++) 00068 if (pU[i]==pNULL) 00069 return false; 00070 00071 for (int i=0;i<nOutputs;i++) 00072 if (pY[i]==pNULL) 00073 return false; 00074 00075 return true; 00076 }
Copyright 2003 P&P Software GmbH - All Rights Reserved