ROSE  0.9.10.91
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::SerialInput Class Reference

Description

Input binary analysis state.

Reads a previously saved binary analysis state file to re-initialize ROSE to a previous state.

Definition at line 422 of file BinarySerialIo.h.

#include <BinarySerialIo.h>

Inheritance diagram for Rose::BinaryAnalysis::SerialInput:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::SerialInput:
Collaboration graph
[legend]

Public Types

typedef Sawyer::SharedPointer< SerialInputPtr
 
- Public Types inherited from Rose::BinaryAnalysis::SerialIo
enum  Format {
  BINARY,
  TEXT,
  XML
}
 Format of the state file. More...
 
enum  Savable {
  NO_OBJECT = 0x00000000,
  PARTITIONER = 0x00000001,
  AST = 0x00000002,
  END_OF_DATA = 0x0000fffe,
  ERROR = 0x0000ffff,
  USER_DEFINED = 0x00010000,
  USER_DEFINED_LAST = 0xffffffff
}
 Types of objects that can be saved. More...
 
typedef Sawyer::SharedPointer< SerialIoPtr
 Reference-counting pointer. More...
 

Public Member Functions

void open (const boost::filesystem::path &fileName) ROSE_OVERRIDE
 Attach a file. More...
 
void close () ROSE_OVERRIDE
 Detach a file. More...
 
Savable nextObjectType ()
 Type of next object in the input stream. More...
 
Partitioner2::Partitioner loadPartitioner ()
 Load a partitioner from the input stream. More...
 
SgNodeloadAst ()
 Load an AST from the input stream. More...
 
template<class T >
loadObject (Savable objectTypeId)
 
- Public Member Functions inherited from Rose::BinaryAnalysis::SerialIo
virtual ~SerialIo ()
 Destructor. More...
 
bool isOpen () const
 Whether a file is attached. More...
 
Savable objectType () const
 Type ID for next object. More...
 
Format format () const
 Property: File format. More...
 
void format (Format)
 Property: File format. More...
 
Progress::Ptr progress () const
 Property: Progress reporter. More...
 
void progress (const Progress::Ptr &)
 Property: Progress reporter. More...
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 
 SharedObject (const SharedObject &)
 Copy constructor. More...
 
virtual ~SharedObject ()
 Virtual destructor. More...
 
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
 

Static Public Member Functions

static Ptr instance ()
 Factory method to create a new instance. More...
 

Protected Member Functions

void advanceObjectType ()
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::SerialIo
void setIsOpen (bool b)
 
void objectType (Savable)
 

Additional Inherited Members

- Static Public Attributes inherited from Rose::BinaryAnalysis::SerialIo
static Sawyer::Message::Facility mlog
 Message facility. More...
 
- Protected Attributes inherited from Rose::BinaryAnalysis::SerialIo
Sawyer::ProgressBar< size_t > progressBar_
 
int fd_
 

Member Function Documentation

void Rose::BinaryAnalysis::SerialInput::open ( const boost::filesystem::path &  )
virtual

Attach a file.

When opening an output stream, the file is created or truncated; when opening an input stream the file must already exist. If a file is already attached, then the previous file is closed first before this new one is opened.

Throws an Exception if the file cannot be attached or the previous if any, cannot be closed.

Thread safety: This method is not thread-safe.

Implements Rose::BinaryAnalysis::SerialIo.

void Rose::BinaryAnalysis::SerialInput::close ( )
virtual

Detach a file.

If a file is attached to this I/O object, that file is closed and this object is set to its detached state. This is a no-op if no file is attached.

Throws an Exception if the file cannot be detached.

The close method is automatically called during object destruction, although its exceptions are suppressed in that situation.

Thread safety: This method is not thread-safe.

Implements Rose::BinaryAnalysis::SerialIo.

static Ptr Rose::BinaryAnalysis::SerialInput::instance ( )
inlinestatic

Factory method to create a new instance.

The returned instance is in a detached state, therefore the open method needs to be called before any I/O operation can be invoked.

Definition at line 452 of file BinarySerialIo.h.

Savable Rose::BinaryAnalysis::SerialInput::nextObjectType ( )

Type of next object in the input stream.

Returns an indication for the type of the next item in the input stream.

Throws an Exception if no file is attached.

Thread safety: This method is not thread safe.

Partitioner2::Partitioner Rose::BinaryAnalysis::SerialInput::loadPartitioner ( )

Load a partitioner from the input stream.

Initializes the specified partitioner with data from the input stream.

Throws an Exception if no file is attached to this I/O object or if the next object to be read from the input is not a partitioner, or if any other errors occur while reading the partitioner.

SgNode* Rose::BinaryAnalysis::SerialInput::loadAst ( )

Load an AST from the input stream.

Loads an AST from the intput stream and returns a pointer to its root. If a null AST was stored, then a null pointer is returned.

Throws an Exception if no file is attached to this I/O object or if the next object to be read from the input is not an AST, or if any other errors occur while reading the AST.


The documentation for this class was generated from the following file: