lgrEditorInterface.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00009 
00010 #ifndef lgrEditorInterface_H_
00011 #define lgrEditorInterface_H_
00012 
00013 #include "lgrSystemInterface.h"
00014 #include "lgrExportType.h"
00015 #include "virtualConstructor.h"
00016 
00017 #include <memory>
00018 #include <map>
00019 #include <vlutil/vlString.h>
00020 
00021 namespace MAKLogger
00022 {
00023 
00024    class DtLogger;
00025    class DtLgrPacketPrinter;
00026    class DtLgrEditorCommandFactory;
00027    class DtLgrEditorDriver;
00028 
00031    class DT_DLL_LGRCORE DtLgrEditorInterface : public virtual DtLgrSystemInterface
00032    {
00033    public:
00034 
00036       enum FileDataOperations
00037       {
00038          DataAdded,
00039          DataDeleted,
00040          DataMoved
00041       };
00042 
00043       enum ExportType
00044       {
00045          UserExport,
00046          UserExportSelectionOnly,
00047          InternalExport
00048       };
00049 
00050       //Used to shorten code.
00051       typedef DtLgrEditorCommandFactory Factory;
00052 
00053       //Used to shorten code.
00054       typedef DtLgrEditorInterface ThisClass;
00055 
00056       //Map used to store export types.
00057       typedef std::map<DtString,DtLgrExportType> ExportTypeMap;
00058 
00060       static DtLgrEditorInterface* create(DtLogger&);
00061 
00064       static DtLgrEditorInterface* createNonThreadsafe(DtLogger& logger,
00065          const DtLgrEditorDriver& driver);
00066 
00068       virtual ~DtLgrEditorInterface();
00069 
00071       virtual void clearSection(const DtAbsoluteTime& start,
00072          const DtAbsoluteTime& stop) const;
00073 
00075       virtual void cutSection(const DtAbsoluteTime& start,
00076          const DtAbsoluteTime& stop) const;
00077 
00079       virtual void exportFile(const DtString& exportType,
00080          const DtString& filename, bool recheckpoint,
00081          bool openAfterExport) const;
00082 
00084       virtual void exportSection(const DtString& exportType,
00085          const DtString& filename, const DtAbsoluteTime& start,
00086          const DtAbsoluteTime& stop, const DtRelativeTime& offset,
00087          bool recheckpoint,bool openAfterExport) const;
00088 
00090       virtual void mergeInFile(const DtString& filename, const DtRelativeTime&
00091          offset) const;
00092 
00094       virtual void appendFileToEnd( const DtString& filename) const;
00095 
00097       virtual void prefixFileToStart( const DtString& filename) const;
00098 
00100       virtual void trimStart() const;
00101 
00103       virtual void offsetTime(const DtRelativeTime& offset) const;
00104 
00106       virtual void convertFile() const;
00107 
00111       virtual void addExportType(const DtString& fileFormat,
00112          const DtString& fileFilter, bool offsetData,bool generateData,
00113          ExportType exportType, std::auto_ptr<DtLgrPacketPrinter> printer) const;
00114 
00116       const ExportTypeMap& exportTypes() const;
00117 
00119       DtValueSignal<DtString> exportTypeAddedSignal;
00120 
00122       DtValueSignal<DtString> exportCompletedSignal;
00123 
00125       DtValueSignal<DtString> exportCanceledSignal;
00126 
00128       DtValueSignal<FileDataOperations> dataOperationSignal;
00129 
00131       const DtAbsoluteTime& lastOperationStart() const;
00132 
00134       const DtAbsoluteTime& lastOperationEnd() const;
00135 
00137       const DtRelativeTime& lastOperationOffset() const;
00138 
00140       const DtString& lastOperationSource() const;
00141 
00143       const DtString& completedExportType() const;
00144 
00146       const DtString& completedExportDestination() const;
00147 
00148    protected:
00149 
00151       void exportTypeAdded(DtResponse response);
00152 
00154       void dataAdded(DtResponse response);
00155 
00157       void dataDeleted(DtResponse response);
00158 
00160       void dataMoved(DtResponse response);
00161 
00163       void exportCompleted(DtResponse response);
00164 
00166       DtLgrEditorInterface(DtLogger& logger,const DtLgrEditorDriver& driver);
00167 
00169       void connectResponse(DtLgrCommandId id,
00170          void (DtLgrEditorInterface::* function)(DtResponse));
00171 
00172    private:
00174       DtLgrEditorInterface(const DtLgrEditorInterface&);
00176       DtLgrEditorInterface& operator=(const DtLgrEditorInterface&);
00177 
00178    protected:
00179       ExportTypeMap myExportTypes;
00180       DtString myNewestExportType;
00181       FileDataOperations myLastOperation;
00182 
00183       DtAbsoluteTime myLastOperationStart;
00184       DtAbsoluteTime myLastOperationEnd;
00185       DtRelativeTime myLastOperationOffset;
00186       DtString myLastOperationSource;
00187       DtString myLastExportType;
00188       DtString myLastExportName;
00189 
00190    };
00191 
00192 }
00193 
00194 #endif

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)