当前位置: 首页>>代码示例>>C++>>正文


C++ TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons方法代码示例

本文整理汇总了C++中TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons方法的具体用法?C++ TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons怎么用?C++ TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeStamp的用法示例。


在下文中一共展示了TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: r

    odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode RecorderModule::body() {
        // Check if the recorder is remotely controlled.
        bool remoteControl = (getKeyValueConfiguration().getValue<bool>("odrecorder.remoteControl") != 0);

        // URL for storing containers.
        string recorderOutputURL;
        try {
            recorderOutputURL = getKeyValueConfiguration().getValue<string>("odrecorder.output");
        }
        catch(...) {
            // If omitted, generate a CID/Name/TimeStamp-based one.
            stringstream recordingURL;
            TimeStamp startOfRecording;
            recordingURL << "file://" << "CID-" << getCID() << "-" << getName() << "_" << startOfRecording.getYYYYMMDD_HHMMSS_noBlankNoColons() << ".rec";
            recorderOutputURL = recordingURL.str();
        }

        // Size of memory segments.
        const uint32_t MEMORY_SEGMENT_SIZE = getKeyValueConfiguration().getValue<uint32_t>("global.buffer.memorySegmentSize");
        // Number of memory segments.
        const uint32_t NUMBER_OF_SEGMENTS = getKeyValueConfiguration().getValue<uint32_t>("global.buffer.numberOfMemorySegments");
        // Run recorder in asynchronous mode to allow real-time recording in background.
        const bool THREADING = true;
        // Dump shared images and shared data?
        const bool DUMP_SHARED_DATA = getKeyValueConfiguration().getValue<uint32_t>("odrecorder.dumpshareddata") == 1;

        // Actual "recording" interface.
        Recorder r(recorderOutputURL, MEMORY_SEGMENT_SIZE, NUMBER_OF_SEGMENTS, THREADING, DUMP_SHARED_DATA);

        // Connect recorder's FIFOQueue to record all containers except for shared images/shared data.
        addDataStoreFor(r.getFIFO());

        // Connect recorder's data store that can handle shared data.
        addDataStoreFor(odcore::data::SharedData::ID(), r.getDataStoreForSharedData());
        addDataStoreFor(odcore::data::image::SharedImage::ID(), r.getDataStoreForSharedData());
        addDataStoreFor(odcore::data::SharedPointCloud::ID(), r.getDataStoreForSharedData());

        // Get key/value-datastore for controlling the odrecorder.
        KeyValueDataStore &kvds = getKeyValueDataStore();

        // If remote control is disabled, simply start recording immediately.
        bool recording = (!remoteControl);
        while (getModuleStateAndWaitForRemainingTimeInTimeslice() == odcore::data::dmcp::ModuleStateMessage::RUNNING) {
            // Recording queued entries.
            if (recording) {
                if (!r.getFIFO().isEmpty()) {
                    r.recordQueueEntries();
                }
                else {
                    Thread::usleepFor(500);
                }
            }

            // Check for remote control.
            if (remoteControl) {
                Container container = kvds.get(odcore::data::recorder::RecorderCommand::ID());
                if (container.getDataType() == odcore::data::recorder::RecorderCommand::ID()) {
                    odcore::data::recorder::RecorderCommand rc;
                    rc = container.getData<odcore::data::recorder::RecorderCommand>();

                    recording = (rc.getCommand() == odcore::data::recorder::RecorderCommand::RECORD);
                }

                // Discard existing entries.
                if (!recording) {
                    r.getFIFO().clear();
                }
            }
        }

        return odcore::data::dmcp::ModuleExitCodeMessage::OKAY;
    }
开发者ID:se-research,项目名称:OpenDaVINCI,代码行数:72,代码来源:RecorderModule.cpp


注:本文中的TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。