WT_BlockRef Class Reference
[Rendition attributes]

#include <blockref.h>

Inheritance diagram for WT_BlockRef:

Inheritance graph
[legend]
Collaboration diagram for WT_BlockRef:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the currrent block reference.

Deprecated:
BlockRefs were only available in vesion 00.55, they were a short-lived architectural solution that has been deprecated in deference to the DWF 6 package format structure.
For version 00.55, drawables, attributes and other objects can be grouped as blocks in DWF files with some metadata (in uncompressed form) represented as an opcode represented by a WT_BlockRef object. Different kinds of blockref objects would be specified as rendition attributes based on the kind of geometry or data that follows it. As they were serialized, each of those blockref's would be accumulated in the WT_Directory object instance maintained in the WT_File object.

Since certain fields are common to different kinds of blockref's, it was decided to limit the number of WT_Objects that would be added to the toolkit by creating the gigantic three-ton angry gorilla of an object called WT_BlockRef which is capable of serializing all kinds of blockrefs based its format field as well as serving as a lay functionary in various local, state and federal government positions. WT_BlockRef will guarantee that your tax dollars will not get spent unwisely as long as you do not remind it of its true nature: Gorilla - the largest of the anthropoid apes native to the forests of equatorial Africa, having a stocky body and coarse, dark brown or black hair.

Warning:
Do not taunt or attempt to feed WT_BlockRef.

For internal use only.

The BLOCK_VARIABLE_RELATION global static boolean table stores the relevant (applicable) fields for relevant blockref kind. This table essentially decides 'which field gets serialized/materialized for a particular blockref kind'. Modifying this table in future (after a WHIP! toolkit release) would break backward/forward compatibility of dwf file format. Columns and rows could be added at the end without affecting backward or forward compatibility, but they won't be... as this object has been deprecated.

See also:
WT_Rendition

Examples:

WhipExamples/AppendBlocks.cpp, WhipExamples/OutputBlocks.cpp, WhipExamples/ReadTwoBlocks.cpp, WhipExamples/WriteBlocks.cpp, and WhipExamples/WriteRedline.cpp.

Definition at line 108 of file blockref.h.

Public Types

enum  WT_BlockRef_Format
 Based on this and BLOCK_VARIABLE_RELATION table, different member variables of WT_BlockRef class can be serialized.

Public Member Functions

 WT_BlockRef ()
 Constructs a WT_BlockRef object.
 WT_BlockRef (WT_BlockRef_Format format)
 Constructs a WT_BlockRef object with the given format.
 WT_BlockRef (WT_BlockRef const &blockref)
 Constructs a WT_BlockRef object. Copy constructor.
virtual ~WT_BlockRef ()
 Destroys a WT_BlockRef object.
WT_Boolean operator!= (WT_BlockRef const &attrib) const
 Inequality operator. Returns WD_True if the given blockref is NOT equal to this one.
WT_Boolean operator== (WT_BlockRef const &attrib) const
 Equality operator. Returns WD_True if the given blockref is equal to this one.
WT_BlockRef const & operator= (WT_BlockRef const &blockref)
 Assignment operator. Assigns the given blockref's contents to this one.
WT_Unsigned_Integer32 get_block_size () const
 Returns the blockref size (in bytes).
WT_Unsigned_Integer32 get_file_offset () const
 Return the file offset for this object.
WT_BlockRef_Format get_format () const
 Returns the blockref format, one of enum WT_BlockRef_Format..
WT_Integer32 index () const
 Returns the blockref index (in the set of blockrefs.).
void set_format (WT_BlockRef_Format format)
 Sets the blockref format, one of WT_BlockRef_Format "enum WT_BlockRef_Format.".
WT_Result materialize (WT_Opcode const &opcode, WT_File &file)
 Materializes the contents of the object from the file and the given opcode.
WT_ID object_id () const
 Returns the WT_ID for this object.
WT_Type object_type () const
 Returns the object type WT_Type::Attribute.
WT_Result process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
WT_Result serialize (WT_File &file) const
 Forces the serialization of the object to the file.
WT_Result skip_operand (WT_Opcode const &opcode, WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result sync (WT_File &file) const
 Serializes the attribute out to the file, if necessary.
WT_Boolean operator== (WT_Attribute const &attrib) const
 Returns WD_True if the attributes are equal.

Static Public Member Functions

static WT_Result default_process (WT_BlockRef &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Friends

class WT_File
class WT_Directory
class WT_Rendition
class WT_Opcode
class WT_BlockRef_List


Member Function Documentation

static WT_Result WT_BlockRef::default_process WT_BlockRef item,
WT_File file
[static]
 

Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Warning:
This is used by the framework and should not be called by client code.
Parameters:
item  The attribute to process.
file  The file being read.

WT_Unsigned_Integer32 WT_BlockRef::get_file_offset  )  const [inline]
 

Return the file offset for this object.

Note:
There is no set_file_offset method; it is left to the toolkit to figure out the begining blockref opcode file offset when it gets serialized.

Definition at line 181 of file blockref.h.

WT_Result WT_BlockRef::materialize WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Materializes the contents of the object from the file and the given opcode.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Opcode_Not_Valid_For_This_Object The object does not support the opcode type.
WT_Result::Internal_Error Something went very wrong.

Implements WT_Object.

WT_Result WT_BlockRef::process WT_File file  )  [virtual]
 

Calls the configured action handler for this object (passes in the file reference.).

Warning:
This is used by the framework and should not be called by client code.

Implements WT_Object.

WT_Result WT_BlockRef::serialize WT_File file  )  const [virtual]
 

Forces the serialization of the object to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.

Implements WT_Attribute.

WT_Result WT_BlockRef::skip_operand WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Bug:
Not all objects perform skip_operand() correctly; this is a known problem. For best results, if client code must use WT_File::get_next_object_shell() manually, it should also call the corresponding WT_Object::materialize() method to avoid this problem.
See also:
WT_File::get_next_object_shell(), WT_File_Heuristics::set_deferred_delete().

Reimplemented from WT_Object.

WT_Result WT_BlockRef::sync WT_File file  )  const [virtual]
 

Serializes the attribute out to the file, if necessary.

Only outputs relevant desired rendition changes to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
See also:
WT_File::desired_rendition().

Implements WT_Attribute.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:15 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5