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

Doomwad::Sectors Class Reference

Inheritance diagram for Doomwad::Sectors:

Doomwad::WadEntry List of all members.

Detailed Description

Collection of Sector objects.

See also:
Map Sector Sidedefs WadEntry
A Sectors object represents a Sectors entry in a Wad file. It is a collection of Sector objects and acts a lot like the vector from which it inherits.

Definition at line 145 of file sectors.hpp.

Public Member Functions

 Sectors (const Lump &) throw ()
 Construct from a Lump.
 Sectors (void) throw ()
 Default constructor.
virtual bool setFromLump (const Lump &lump) throw ()
 Convert a Lump to this entry.
virtual Lump toLump (void) const throw ()
 Convert this entry to a Lump.
virtual std::string toString (void) const throw ()
 Convert this entry to a std::string.
virtual ~Sectors (void) throw ()
 Destructor.

Static Public Attributes

static const std::string NAME = "SECTORS"
 Name of an entry.


Constructor & Destructor Documentation

Sectors::Sectors const Lump lump  )  throw ()
 

Construct from a Lump.

Constructs a Sectors object given raw Lump data. The constructor parses the Lump into integers and strings, then creates Sector objects from them. It then stores them in order inside of itself.

Parameters:
lump Source Lump from which to pull Sector data.

Definition at line 192 of file sectors.cpp.

References setFromLump().

Sectors::~Sectors void   )  throw () [virtual]
 

Destructor.

Does nothing, but is necessary for inheritance.

Definition at line 203 of file sectors.cpp.


Member Function Documentation

bool Sectors::setFromLump const Lump lump  )  throw () [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.

Implements Doomwad::WadEntry.

Definition at line 208 of file sectors.cpp.

References Doomwad::Sector::read().

Referenced by Sectors().

Lump Sectors::toLump void   )  const throw () [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.

Implements Doomwad::WadEntry.

Definition at line 222 of file sectors.cpp.

References NAME.

std::string Sectors::toString void   )  const throw () [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.

Implements Doomwad::WadEntry.

Definition at line 233 of file sectors.cpp.


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