📄 eventformat.h
字号:
//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, Yusuke Miyao/// You may distribute under the terms of the Artistic License.////// <id>$Id: EventFormat.h,v 1.4 2003/05/16 05:29:08 yusuke Exp $</id>/// <collection>Maximum Entropy Estimator</collection>/// <name>EventFormat.h</name>/// <overview>Basic interface for reading event files</overview>/// <desc>/// This file provides a base class for reading event files/// Data formats should be defined in derived classes./// </desc>/////////////////////////////////////////////////////////////////////////#ifndef Amis_EventFile_h_#define Amis_EventFile_h_#include <amis/configure.h>#include <amis/ModelBase.h>#include <amis/EventSpaceBase.h>#include <amis/ErrorBase.h>#include <amis/StringStream.h>#include <memory>#include <string>AMIS_NAMESPACE_BEGIN///////////////////////////////////////////////////////////////////////// <classdef>/// <name>IllegalEventFormatError</name>/// <overview>Error exception for illegal data format</overview>/// <desc>/// The exception class is thrown by the EventFormat class to signal/// an invalid data in an event file./// </desc>/// <see>EventFormat</see>/// <body>class IllegalEventFormatError : public ErrorBase {public: IllegalEventFormatError( const std::string& s, int num ) : ErrorBase() { OStringStream os; os << s << " at line " << num + 1; m = os.str(); } /// Initialize with an error message IllegalEventFormatError( char* s, int num ) : ErrorBase() { OStringStream os; os << s << " at line " << num + 1; m = os.str(); } /// Initialize with an error message};/// </body>/// </classdef>///////////////////////////////////////////////////////////////////////// <classdef>/// <name>EventFormat</name>/// <overview>Base class for reading event files</overview>/// <desc>/// The class provides a basic interface for importing event/// data from specified data files./// Derived classes should handle format-specific data./// </desc>/// <see>Event, EventSpace</see>/// <body>class EventFormat {public: EventFormat() {} /// Initialize with an event space virtual ~EventFormat() {} /// Destructor for EventFormat virtual std::string eventFormatName() const = 0; /// Name of the event format //virtual void inputEvent( std::istream& s, const ModelBase* model, EventBase* event ) = 0; virtual void inputEventSpace( std::istream& s, const ModelBase& model, EventSpaceBase& event_space ) = 0; /// Input event data from an input stream /* virtual void inputEventsForCount( std::istream& s ) { AMIS_ABORT("Calling not-implemented inputEventsForCount()"); } */};/// </body>/// </classdef>typedef std::auto_ptr< EventFormat > EventFormatPtr;AMIS_NAMESPACE_END#endif // EventFormat_h_// end of EventFormat.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -