OMKOutputNT.cpp

Go to the documentation of this file.
00001 /*
00002  * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software
00003  * 
00004  * The Software has been developped within the Siames Project. 
00005  * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights
00006  * 
00007  * The Software has been registered with the Agence pour la Protection des
00008  * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200
00009  *  
00010  * This file may be distributed under the terms of the Q Public License
00011  * version 1.0 as defined by Trolltech AS of Norway and appearing in the file
00012  * LICENSE.QPL included in the packaging of this file.
00013  *
00014  * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 
00015  * for the software may use this file in accordance with that specific license
00016  *
00017  */
00018 #include "OMKOutputNT.h"
00019 #include "OMKInputNT.h"
00020 #include "OMKSimulatedObject.h"
00021 
00022 using namespace OMK ;
00023 
00024 //-----------------------------------------------------------------------------
00025 
00026 OutputNT::OutputNT( SimulatedObject & owner, const Name & outputName )
00027   : KernelAttribute( owner, outputName )
00028 {
00029 }
00030 
00031 //-----------------------------------------------------------------------------
00032 
00033 OutputNT::~OutputNT() 
00034 {
00035 }
00036 
00037 //-----------------------------------------------------------------------------
00038 
00039 bool OutputNT::connect( const Name & objectName, const Name & inputName )
00040 {
00041   SimulatedObject * object =
00042     _owner.getController().getPointerToSimulatedObjectNamed( objectName ) ;
00043   if( object != 0 )
00044   {
00045     return connect( *object, inputName ) ;
00046   }
00047   else 
00048   {
00049     OMTRACEID( OMK_DEBUG_OMK_EXEC,
00050                "For output \"" << getName() << "\" of "
00051                << OMK::debugMsg( &_owner ) << std::endl
00052                << "OutputNT::unable to connect because object \""
00053                << objectName << "\" cannot be found" ) ;
00054     return false ;
00055   }
00056 }
00057 
00058 //-----------------------------------------------------------------------------
00059 
00060 bool OutputNT::connect( SimulatedObject & object, const Name & inputName )
00061 {
00062   InputNT * input = object.getPointerToInputNamed( inputName ) ;
00063   if( input != 0 )
00064   {
00065     return input->realConnect( this ) ;
00066   }
00067   else
00068   {
00069     OMTRACEID( OMK_DEBUG_OMK_EXEC,
00070                "For output \"" << getName() << "\" of "
00071                << OMK::debugMsg( &_owner ) << std::endl
00072                << "OutputNT::unable to connect because input \""
00073                << inputName << "\" of object \"" << object.getName()
00074                << "\" doesn't exist" ) ;
00075     return false ;
00076   }
00077 }
00078 
00079 //-----------------------------------------------------------------------------
00080 
00081 bool OutputNT::connect( SimulatedObject * pointerToObject,
00082                         const Name & inputName )
00083 {
00084   if( pointerToObject != 0 )
00085   {
00086     return connect( *pointerToObject, inputName ) ;
00087   }
00088   else
00089   {
00090     OMTRACEID( OMK_DEBUG_OMK_EXEC,
00091                "For output \"" << getName() << "\" of "
00092                << OMK::debugMsg( &_owner ) << std::endl
00093                <<"OutputNT::unable to connect because the pointer to the owner of the input is nil" ) ;
00094     return false ;
00095   }
00096 }

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007