Animation::Animation() : m_name(initialName()) , m_property(CSSPropertyInvalid) , m_mode(AnimateAll) , m_iterationCount(initialIterationCount()) , m_delay(initialDelay()) , m_duration(initialDuration()) , m_timingFunction(initialTimingFunction()) #if ENABLE(CSS_ANIMATIONS_LEVEL_2) , m_trigger(initialTrigger()) #endif , m_direction(initialDirection()) , m_fillMode(initialFillMode()) , m_playState(initialPlayState()) , m_delaySet(false) , m_directionSet(false) , m_durationSet(false) , m_fillModeSet(false) , m_iterationCountSet(false) , m_nameSet(false) , m_playStateSet(false) , m_propertySet(false) , m_timingFunctionSet(false) #if ENABLE(CSS_ANIMATIONS_LEVEL_2) , m_triggerSet(false) #endif , m_isNone(false) { }
int Publication::svc () { if( !this->enabled_) { if( this->verbose_) { ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("not enabled, declining to process.\n"), this->name_.c_str() )); } return 0; } else if( this->verbose_) { ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("processing starts on thread.\n"), this->name_.c_str() )); } // Honor a request to delay the start of publication. if( this->profile_->delay > 0) { ACE_Time_Value initialDelay( this->profile_->delay, 0); ACE_OS::sleep( initialDelay); if( this->verbose_) { ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("publication starting after initial delay.\n"), this->name_.c_str() )); } } OpenDDS::DCPS::DataWriterImpl* servant = dynamic_cast< OpenDDS::DCPS::DataWriterImpl*>( this->writer_.in()); OpenDDS::DCPS::GuidConverter converter(servant->get_publication_id()); int pid = converter.checksum(); ACE_Time_Value startTime = ACE_High_Res_Timer::gettimeofday_hr(); int count = 0; Test::Data sample; sample.priority = this->profile_->writerQos.transport_priority.value; sample.pid = pid; // Main loop for publishing. while( this->done_ == false) { sample.buffer.length( *this->profile_->size); sample.key = *this->profile_->instances; sample.seq = ++count; ACE_Time_Value start = ACE_High_Res_Timer::gettimeofday_hr(); DDS::Duration_t stamp = ::OpenDDS::DCPS::time_value_to_duration( start); sample.sec = stamp.sec; sample.nanosec = stamp.nanosec; DDS::ReturnCode_t result; { ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, guard, this->lock_, 0); result = this->writer_->write( sample, DDS::HANDLE_NIL); } switch( result) { case DDS::RETCODE_OK: ++this->messages_; break; case DDS::RETCODE_TIMEOUT: ++this->timeouts_; break; default: ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("write failed with code: %d.\n"), this->name_.c_str(), result )); break; } // Determine the interval to next message here so it can be mentioned // in the diagnostic messsage. long microseconds = static_cast<long>( 1.0e6 * *this->profile_->rate); ACE_Time_Value interval( 0, microseconds); if( this->verbose_ && BE_REALLY_VERBOSE) { ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("wrote sample %d at priority %d, ") ACE_TEXT("waiting %d microseconds to send next one.\n"), this->name_.c_str(), count, this->profile_->writerQos.transport_priority.value, interval.usec() )); } // Wait the remainder of the interval before sending the next message. ACE_Time_Value now = ACE_High_Res_Timer::gettimeofday_hr(); interval -= (now - start); if( interval > ACE_Time_Value::zero) { ACE_OS::sleep( interval); } } // Wait for data to be delivered if we have been asked to. if( this->profile_->ackDelay) { DDS::Duration_t timeout = {CORBA::Long(this->profile_->ackDelay), 0}; DDS::ReturnCode_t result; result = this->writer_->wait_for_acknowledgments( timeout); switch( result) { case DDS::RETCODE_OK: break; case DDS::RETCODE_TIMEOUT: ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("failed waiting %d seconds for acknowledgments.\n"), this->name_.c_str(), this->profile_->ackDelay )); break; default: ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("write failed with code: %d.\n"), this->name_.c_str(), result )); break; } } ACE_Time_Value elapsedTime = ACE_High_Res_Timer::gettimeofday_hr() - startTime; this->duration_ = elapsedTime.sec() + (elapsedTime.usec() * 1.0e-6); if( this->verbose_) { ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) Publication::svc() - publication %C: ") ACE_TEXT("honoring termination request, stopping thread.\n"), this->name_.c_str() )); } return 0; }
CSSTimingData::CSSTimingData() { m_delayList.push_back(initialDelay()); m_durationList.push_back(initialDuration()); m_timingFunctionList.push_back(initialTimingFunction()); }