|
Go to the documentation of this file.
50 FD_DHV( "AttributeDeviceEvent::AttributeDeviceEvent(" << this << ")");
51 pOutputPrototype= FallbackAttributep();
52 pInputPrototype= FallbackAttributep();
63 FD_DHV( "AttributeDeviceEvent(" << this << "): form other attr " << &rOtherAttr);
91 FD_DHV( "AttributeDeviceEvent(" << this << "):DoAssign(): "
92 << typeid(*this).name() << " from " << typeid(rSrcAttr).name());
109 FD_DHV( "AttributeDeviceEvent(" << this << ")::DoRead(tr)");
170 #ifdef FAUDES_DEBUG_IOPERF
185 static std::set<vDevice*> *dlist = new std::set< vDevice* >();
201 #ifdef FAUDES_DEBUG_IOPERF
214 FD_DHV( "vDevice::FromTokenReader()");
219 std::stringstream errstr;
220 errstr << "Expected Begin Section in \"" << rTr. FileName() << "\"";
221 throw Exception( "vDevice::FromFile", errstr.str(), 52);
225 FD_DHV( "vDevice::FromFile(" << rTr. FileName() << "): device type " << ftype);
228 std::stringstream errstr;
229 errstr << "Unknown type \"" << ftype << "\" at \"" << rTr. FileLine() << "\"";
230 throw Exception( "vDevice()::FromFile", errstr.str(), 52);
236 std::stringstream errstr;
237 errstr << "Could not cast to device object from type \"" << ftype << "\" at \"" << rTr. FileLine() << "\")";
238 throw Exception( "vDevice()::FromFile", errstr.str(), 52);
249 FD_DHV( "vDevice::FromFile(" << rFileName << ")");
261 FD_DH( "vDevice::StopAll()");
263 std::set<vDevice*>::const_iterator dit;
265 if( dynamic_cast<xDevice*>(*dit) ) continue;
266 FD_DH( "vDevice::StopAll(): Reset: " << (*dit)->Name());
271 if( dynamic_cast<xDevice*>(*dit) ) continue;
272 FD_DH( "vDevice::StopAll(): Stop " << (*dit)->Name());
285 std::stringstream errstr;
286 errstr << "cannot start device when not configured";
287 throw Exception( "vDevice()::Start()", errstr.str(), 550);
339 FD_DHV( "vDevice(" << mName << ")::Name(\"" << rName << "\")");
359 switch(currentState) {
360 case Down: res= "down"; break;
361 case StartUp: res= "starting up"; break;
362 case Up: res= "up and running"; break;
363 case ShutDown: res= "shutting down"; break;
372 (void) pContext; (void) rTw;
375 std::string label=rLabel;
394 (void) pContext; (void) rTw;
407 (void) pContext; (void) rTw;
409 FD_DHV( "vDevice("<< mName<< ")::DoWriteConfiguration()");
411 std::string label=rLabel;
412 if(label == "") label = "EventConfiguration";
419 #ifdef FAUDES_DEBUG_CODE
421 std::stringstream errstr;
422 errstr << "Invalid attribute configuration";
423 throw Exception( "vDevice::DoWriteConfiguration", errstr.str(), 550);
449 attrp-> Write(rTw, "",pContext);
450 etoken.SetEnd( "Event");
464 (void) pContext; (void) rLabel; (void) rTr;
469 std::string label = rLabel;
492 std::string label=rLabel;
493 if(label== "") label= "EventConfiguration";
505 FD_DHV( "vDevice("<< mName<< ")::DoReadConfiguration()");
509 #ifdef FAUDES_DEBUG_CODE
511 std::stringstream errstr;
512 errstr << "Invalid attribute configuration" << rTr. FileLine();
513 throw Exception( "vDevice::DoReadConfiguration", errstr.str(), 550);
517 FD_DHV( "vDevice::DoReadConfiguration(" << this << "): attribute type " << typeid(*attrp).name());
521 while(!rTr. Eos(label)) {
530 attrp-> Read(rTr, "",pContext);
542 FD_DHV( "vDevice(" << this << ")::DoReadConfiguration(..): " << token. Str() << "\"");
553 if((iotype== "input") || (iotype== "output")) {
563 std::stringstream errstr;
564 errstr << "Invalid token of type " << token. Type() << " at " << rTr. FileLine();
565 throw Exception( "vDevice::DoReadConfiguration", errstr.str(), 50);
573 (void) pContext; (void) rLabel; (void) rTr;
606 FD_DHV( "vDevice(" << mName << ")::Configure(event)");
610 std::stringstream errstr;
611 errstr << "Cannot cast attribute to device event attribute";
612 throw Exception( "vDevice::Configure", errstr.str(), 550);
623 FD_DHV( "vDevice(" << mName << ")::Configure(alphabet)");
627 std::stringstream errstr;
628 errstr << "Cannot cast attribute to device event attribute";
629 throw Exception( "vDevice::Configure", errstr.str(), 550);
632 for(EventSet::Iterator eit=rPhysicalEvents. Begin(); eit!=rPhysicalEvents. End(); eit++) {
656 std::stringstream errstr;
657 errstr << "Cannot cast attribute to device event attribute";
658 throw Exception( "vDevice()::Configure", errstr.str(), 550);
668 FD_DHV( "vDevice(" << mName << ")::UseCondition()");
698 faudes_systime_t res;
700 faudes_systime_t now;
701 faudes_gettimeofday(&now);
705 faudes_systime_t delta;
706 delta.tv_sec = durationMsec/1000;
707 delta.tv_nsec = ( durationMsec - (delta.tv_sec*1000) ) *1000000;
730 return ( long int)((1.0/ mTimeScale)*real_time/1000*1000);
738 faudes_systime_t now;
739 faudes_gettimeofday(&now);
741 faudes_systime_t diff;
744 return ( long int) ((1000.0/ mTimeScale) * (diff.tv_sec + diff.tv_nsec*1e-9));
759 faudes_systime_t now;
760 faudes_gettimeofday(&now);
762 faudes_systime_t diffTime;
765 return 1000*diffTime.tv_sec + diffTime.tv_nsec/1000000;
772 FD_DHV( "vDevice("<< mName<< ")::CurrentTimeMs(nowms) ");
774 faudes_systime_t now;
775 faudes_gettimeofday(&now);
777 faudes_systime_t delta;
778 delta.tv_sec = nowms/1000;
779 delta.tv_nsec = 1000000*(nowms%1000);
798 FD_DHV( "vDevice("<< mName<< ")::WaitInputs("<< duration << ")");
801 if(duration> 3600*24) { duration= 3600*24;};
813 if(!sr && duration>0) {
815 #ifdef FAUDES_DEBUG_IOPERF
817 faudes_systime_t now;
818 faudes_gettimeofday(&now);
825 FD_DHV( "vDevice("<< mName<< ")::WaitInputs("<< duration << "): waiting for condition");
831 #ifdef FAUDES_DEBUG_IOPERF
833 faudes_gettimeofday(&now);
858 FD_DHV( "vDevice("<< mName<< ")::WaitInputsMs("<< duration << ")");
861 if(duration> 30*3600*24) { duration= 30*3600*24;};
872 if(!sr && duration>0) {
874 #ifdef FAUDES_DEBUG_IOPERF
876 faudes_systime_t now;
877 faudes_gettimeofday(&now);
882 faudes_systime_t condtime;
889 #ifdef FAUDES_DEBUG_IOPERF
891 faudes_gettimeofday(&now);
939 FD_DHV( "vDevice("<< mName<< ")::ReadInput(): found: " << res);
960 FD_DHV( "vDevice("<< mName<< ")::PeekInput(): found: " << res);
983 #ifdef FAUDES_DEBUG_IOPERF
989 busyduration. Dim(50);
990 busyduration. Clear();
991 busyduration. Name( "performance " + Name() + " (busy duration in usecs)");
999 faudes_systime_t busy;
1001 busyduration. Sample(busy.tv_sec*1000000 + busy.tv_nsec/1000);
1008 return busyduration;
1012 FD_DHV( "vDevice::Performance(" << Name() << "): not enabled");
1014 busyduration. Name( "performance monitoring not enabled");
1015 return busyduration;
1022 #ifdef FAUDES_DEBUG_IOPERF
1025 busyduration. Write();
1027 std::cout << busyduration. Str() << std::endl;
1034 #ifdef FAUDES_DEBUG_IOPERF
libFAUDES 2.26g
--- 2015.08.17
--- c++ api documentaion by doxygen
|