Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Doomwad::WadEntry Class Reference

Inheritance diagram for Doomwad::WadEntry:

Doomwad::Animated Doomwad::Blockmap Doomwad::ColorMap Doomwad::Flat Doomwad::GLNodes Doomwad::GLSegs Doomwad::GLSsectors Doomwad::GLVertexes Doomwad::HexenLinedefs Doomwad::HexenThings Doomwad::HTranMap Doomwad::Linedefs Doomwad::Nodes Doomwad::PlayPal Doomwad::PNames Doomwad::Reject Doomwad::Sectors Doomwad::Segs Doomwad::Sidedefs Doomwad::Ssectors Doomwad::Switches Doomwad::Textures Doomwad::TextWadEntry Doomwad::Things Doomwad::Vertexes List of all members.

Detailed Description

Abstract base class for entries in a Wad.

See also:
Lump TextWadEntry WadEntryElement
This class defines basic functions that are common to all entries. It also allows for polymorphic behavior from its subclasses.

The important thing is that it provides a common interface for moving between Lump objects and the various entry objects. It guarantees this ability, while providing it with polymorphism when appropriate.

Definition at line 86 of file wadentry.hpp.

Public Member Functions

virtual bool setFromLump (const Lump &lump)=0 throw ()
 Convert a Lump to this entry.
virtual Lump toLump (void) const =0 throw ()
 Convert this entry to a Lump.
virtual std::string toString (void) const =0 throw ()
 Convert this entry to a std::string.
virtual ~WadEntry (void) throw ()
 Destructor.


Constructor & Destructor Documentation

virtual Doomwad::WadEntry::~WadEntry void   )  throw () [inline, virtual]
 

Destructor.

Every function in this class is pure virtual, but C++ requires parent classes to define a destructor and it must be virtual. While WadEntry has no need for a destructor, it must define one to be standards compliant.

Definition at line 98 of file wadentry.hpp.


Member Function Documentation

virtual bool Doomwad::WadEntry::setFromLump const Lump lump  )  throw () [pure virtual]
 

Convert a Lump to this entry.

Lumps should not know about specific data structures. Those structures know about Lumps, including how to convert from them.

Setting from a Lump involves parsing that Lump's contents to see if they are valid. If they are, then this object will contain what you expect it to. If not, it will return false and the atomic operation will not succeed.

Parameters:
lump Reference to a source Lump object.
Returns:
True if successful, false if not.

Implemented in Doomwad::Animated, Doomwad::Blockmap, Doomwad::ColorMap, Doomwad::Flat, Doomwad::HTranMap, Doomwad::Linedefs, Doomwad::HexenLinedefs, Doomwad::Nodes, Doomwad::GLNodes, Doomwad::PlayPal, Doomwad::Reject, Doomwad::Sectors, Doomwad::Segs, Doomwad::GLSegs, Doomwad::Sidedefs, Doomwad::Ssectors, Doomwad::GLSsectors, Doomwad::Switches, Doomwad::Things, Doomwad::HexenThings, Doomwad::Vertexes, Doomwad::GLVertexes, and Doomwad::TextWadEntry.

virtual Lump Doomwad::WadEntry::toLump void   )  const throw () [pure virtual]
 

Convert this entry to a Lump.

Each subclass must be able to convert itself to a Lump for storage in a Wad.

Returns:
Lump containing the raw file representation of this entry.

Implemented in Doomwad::Animated, Doomwad::Blockmap, Doomwad::ColorMap, Doomwad::Flat, Doomwad::HTranMap, Doomwad::Linedefs, Doomwad::HexenLinedefs, Doomwad::Nodes, Doomwad::GLNodes, Doomwad::PlayPal, Doomwad::Reject, Doomwad::Sectors, Doomwad::Segs, Doomwad::GLSegs, Doomwad::Sidedefs, Doomwad::Ssectors, Doomwad::GLSsectors, Doomwad::Switches, Doomwad::Things, Doomwad::HexenThings, Doomwad::Vertexes, Doomwad::GLVertexes, and Doomwad::TextWadEntry.

virtual std::string Doomwad::WadEntry::toString void   )  const throw () [pure virtual]
 

Convert this entry to a std::string.

The exact implementation varies by the exact concrete class, but the idea is to convert the entry into a summary to be displayed to the user. Please note that converting to a string may lose information. This is not serialization in the purest sense of the word, this is merely a quick and dirty user-readable summary of the entry.

True serialization is achieved by converting a Lump object and using its stream I/O functions to read and write.

Returns:
std::string containing a summary of this entry.

Implemented in Doomwad::Animated, Doomwad::Blockmap, Doomwad::ColorMap, Doomwad::Flat, Doomwad::HTranMap, Doomwad::Linedefs, Doomwad::HexenLinedefs, Doomwad::Nodes, Doomwad::GLNodes, Doomwad::PlayPal, Doomwad::Reject, Doomwad::Sectors, Doomwad::Segs, Doomwad::GLSegs, Doomwad::Sidedefs, Doomwad::Ssectors, Doomwad::GLSsectors, Doomwad::Switches, Doomwad::Things, Doomwad::HexenThings, Doomwad::Vertexes, Doomwad::GLVertexes, and Doomwad::TextWadEntry.


Generated on Fri Jun 10 19:38:52 2005 for libdoomwad by  doxygen 1.4.0