CMS 3D CMS Logo

VisContent.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "VisFramework/VisFrameworkBase/interface/VisContent.h"
00004 #include "VisFramework/VisFrameworkBase/interface/VisQueueProcessor.h"
00005 #include "VisFramework/VisFrameworkBase/interface/VisQueue.h"
00006 #include <iostream>
00007 #include <classlib/utils/Callback.h>
00008 
00009 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00010 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00011 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00012 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00013 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00014 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00015 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00016 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00017 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00018 
00019 VisContent::VisContent (IgState *state, IgStateKey key,
00020                         Type which, lat::Callback action)
00021     : m_state (state),
00022       m_key (key)
00023 {
00024     ASSERT (m_state);
00025     m_state->put (m_key, this);
00026     
00027     if (which == MAIN_THREAD && action)
00028         action ();
00029     else if (which == EVENT_THREAD && action)
00030         // Schedule the initialisation as appropriate
00031         if (VisQueueProcessor::get (m_state))
00032             VisQueue::get (m_state)->push (action);
00033         else
00034             action ();
00035 }
00036 
00037 VisContent::VisContent (IgState *state, IgStateKey key,
00038                         lat::Callback mainAction, lat::Callback eventAction)
00039     : m_state (state),
00040       m_key (key)
00041 {
00042     ASSERT (m_state);
00043     m_state->put (m_key, this);
00044     
00045     if (mainAction)
00046         mainAction ();
00047     if (eventAction)
00048         // Schedule the initialisation as appropriate
00049         if (VisQueueProcessor::get (m_state))
00050             VisQueue::get (m_state)->push (eventAction);
00051         else
00052             eventAction ();
00053 }
00054  
00057  VisContent::~VisContent (void)
00058 { ASSERT (m_state); m_state->detach (m_key); }

Generated on Tue Jun 9 17:49:56 2009 for CMSSW by  doxygen 1.5.4