Logo Search packages:      
Sourcecode: blender version File versions

GHOST_TSuccess GHOST_EventManager::addConsumer ( GHOST_IEventConsumer consumer  )  [virtual]

Adds a consumer to the list of event consumers.

Parameters:
consumer The consumer added to the list.
Returns:
Indication as to whether addition has succeeded.

Definition at line 153 of file GHOST_EventManager.cpp.

References m_consumers.

Referenced by GHOST_System::addEventConsumer(), and GHOST_System::init().

{
      GHOST_TSuccess success;
      GHOST_ASSERT(consumer, "invalid consumer");
      
      // Check to see whether the consumer is already in our list
      TConsumerVector::const_iterator iter = std::find(m_consumers.begin(), m_consumers.end(), consumer);

      if (iter == m_consumers.end()) {
            // Add the consumer
            m_consumers.push_back(consumer);
            success = GHOST_kSuccess;
      }
      else {
            success = GHOST_kFailure;
      }
      return success;
}


Generated by  Doxygen 1.6.0   Back to index