Mkd64 module API  1.3b
API for creating own mkd64 modules
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Image Class Reference

Class representing a D64 image in memory. More...

#include <mkd64/image.h>

Related Functions

(Note that these are not member functions.)

BlockStatus Image_blockStatus (const Image *self, const BlockPosition *pos)
 Get the current status of a block at a given position.
TrackImage_track (const Image *self, int tracknum)
 Get track object for a given track number.
BlockImage_block (const Image *self, const BlockPosition *pos)
 Get block object for a given position.
BlockImage_allocateAt (const Image *self, const BlockPosition *pos)
 Try to allocate a block at a fixed position.
void Image_setAllocator (Image *self, IBlockAllocator *allocator)
 Set custom allocator.
IBlockAllocatorImage_allocator (const Image *self)
 Get current allocator.

Detailed Description

Class representing a D64 image in memory.

Friends And Related Function Documentation

Block * Image_allocateAt ( const Image self,
const BlockPosition pos 
)
related

Try to allocate a block at a fixed position.

This tries to allocate a given block. A module reserving this block is asked to release it if necessary. It will fail if the block is already allocated or a module reserving it refuses to release it.

Parameters
selfthe image
posthe position of the block to allocate
Returns
the allocated block object or 0 if allocation was not possible
IBlockAllocator * Image_allocator ( const Image self)
related

Get current allocator.

Get a pointer to the IBlockAllocator instance currently in use.

Parameters
selfthe image
Returns
the allocator
Block * Image_block ( const Image self,
const BlockPosition pos 
)
related

Get block object for a given position.

This also locates blocks on tracks from modules providing extra tracks

Parameters
selfthe image
posthe position of the block to get
Returns
the block object or 0 if no block wit the given position exists
BlockStatus Image_blockStatus ( const Image self,
const BlockPosition pos 
)
related

Get the current status of a block at a given position.

Parameters
selfthe image
posthe position of the block
Returns
the status of the block
void Image_setAllocator ( Image self,
IBlockAllocator allocator 
)
related

Set custom allocator.

Set an IBlockAllocator instance to handle block allocations while writing files. The Image class has a default allocator that is used if this is never called – the default allocator is looking sequentially for free blocks, starting at track #1.

Parameters
selfthe image
allocatorthe allocator to use
Track * Image_track ( const Image self,
int  tracknum 
)
related

Get track object for a given track number.

This also tries to get a track from modules providing extra tracks

Parameters
selfthe image
tracknumthe number of the track to get
Returns
the track object or 0 if no track with that number exists

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