An file-based cache for IPixelPyramid s and ITexelPyramid s.
sealed class
|
PyramidFileCache
|
extends
|
Disposable
|
||
implements
|
IConfigurable
|
||||
IFlushable
|
|||||
IPathInfo
|
Instances of PyramidFileCache are automatically shared between threads of the same process. This is transparent to the using code. Pyramid file caches can also be shared between multiple processes resp. machines, with the restriction that all shared pyramid file caches must be opened read-only mode (see Open), which implies that the shared pyramid file cache must have been warmed up in a pre-processing step.
The following table shows the binary layout of a pyramid cache (multibyte values are encoded as LittleEndian).
Offset | Type | Count | Description -----------+-------+-------+---------------------------------------------------- #0 .. #7 | int8 | 8 | Magic value that identifies a file used by a | | | pyramid cache: | | | 0x89 0x50 0x59 0x43 0x0D 0x0A 0x1A 0x0A -----------+-------+-------+---------------------------------------------------- #8 .. #9 | int16 | 1 | Binary format version (currently 1). -----------+-------+-------+---------------------------------------------------- #10 .. #17 | int64 | 1 | Maximum file size, in bytes. -----------+-------+-------+---------------------------------------------------- #18 .. #21 | int32 | 1 | Maximum tile age, in seconds. -----------+-------+-------+---------------------------------------------------- #22 .. #39 | int8 | 18 | Reserved (must be all zero). -----------+-------+-------+---------------------------------------------------- #40 .. #47 | int64 | 1 | Block ID of root of primary tile index. -----------+-------+-------+---------------------------------------------------- #48 .. #55 | int8 | 8 | Reserved, must be zero. -----------+-------+-------+---------------------------------------------------- #56 .. #63 | int64 | 1 | Block ID of root of timestamp index "LastUsed". -----------+-------+-------+---------------------------------------------------- #64 .. EOF | int8 | ? | Data area of pyramid cache. -----------+-------+-------+----------------------------------------------------The data area of a pyramid cache dataset is managed by an embedded BlockStorage.
The configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<PyramidFileCache>
|
||
value
|
|
The configurator object. |
Returns the configuration value that describes this object.
public
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
implements
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
Exceptions:
The logger object of this class.
public
static
readonly
field
|
Logger
|
||
type
|
ILogger
|
Is the pyramid file cache in read-only mode?
public
property
|
IsReadOnly
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
pyramid
file
cache
is
in
read-only
mode,
false
if
the
pyramid
file
cache
is
in
read-write
mode.
|
Remarks:
In read-only mode, the cache file will not be updated (e.g. add new tiles, updated timestamps, remove expired tiles). In effect, pyramid files that are not present in the cache will be loaded from the underlying pyramid, and the resulting pyramid tile will not be stored in the cache file.
Will this object be disposed upon the next call to Dispose?
[ThreadSafe]
|
||||
public
property
|
IsSoleOwnership
{
get
}
|
|||
type
|
bool
|
|||
value
|
true
if
the
object
will
be
disposed
when
Dispose
is
called,
false
if
the
object
will
not
be
disposed,
because
some
other
code
is
still
holding
shared
ownership
(see
AcquireThrow).
|
|||
inherited
|
Disposable.IsSoleOwnership
|
Returns the lifecycle state of this object.
public
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Is the pyramid file cache currently in locked mode?
public
property
|
Locked
{
get
set
}
|
||
type
|
bool
|
||
value
|
true
if
the
pyramid
file
cache
is
in
locked
mode,
false
if
the
pyramid
file
cache
is
in
unlocked
mode.
|
Remarks:
In locked mode, only those pyramid files that are already present in the cache file will be returned. In effect, the underlying pyramids will never be accessed.
Defaults
to
false
.
Returns a Path object that represents the file path this object is associated with.
public
property
|
PathInfo
{
get
}
|
||
type
|
Path
|
||
value
|
|
The path info. | |
implements
|
IPathInfo.PathInfo
|
Remarks:
Objects that do not have a meaningful file path association simply return Unknown.
Creates a new pyramid file cache.
[OwnerReturn]
|
||||
public
static
method
|
Create
(Path filePath,
PyramidFileCacheOptions options = null)
|
|||
type
|
PyramidFileCache
|
|||
params
|
filePath
|
[not-null]
|
Path to the cache file. | |
options
|
The
options
to
use.
If
null ,
the
default
options
will
be
used.
|
|||
returns
|
|
The pyramid file cache. |
Exceptions:
Opens an existing pyramid file cache or creates a new one if necessary.
[OwnerReturn]
|
||||
public
static
method
|
CreateOrOpen
(Path filePath,
PyramidFileCacheOptions options = null)
|
|||
type
|
PyramidFileCache
|
|||
params
|
filePath
|
[not-null]
|
Path to the cache file. | |
options
|
The
options
to
use.
If
null ,
the
default
options
will
be
used.
|
|||
returns
|
|
The pyramid file cache. |
Remarks:
If the given file path points to a non-existent file, a new pyramid file cache with the given properties will be created. If the file path refers to an existing pyramid file cache, it will be opened iff its options match options; otherwise a new pyramid file cache is created and the existing one is overwritten.
Exceptions:
Opens an existing pyramid file cache.
[OwnerReturn]
|
||||
public
static
method
|
Open
(Path filePath,
bool readOnly = false)
|
|||
type
|
PyramidFileCache
|
|||
params
|
filePath
|
[not-null]
|
Path to the cache file. | |
readOnly
|
Open
pyramid
file
cache
in
read-only
mode?
Use
this
for
sharing
warmed-up
file
caches
between
multiple
processes
or
machines.
Defaults
to
false .
|
|||
returns
|
|
The pyramid file cache. |
Exceptions:
Acquires a strong reference to this disposable object.
[OwnerReturn, Pure]
|
||||
public
method
|
AcquireBase
()
|
|||
type
|
IDisposable
|
|||
returns
|
The
strong
reference
to
this
disposable
object
or
null
iff
this
object
is
no
longer
valid.
|
|||
inherited
|
Disposable.AcquireBase
|
Remarks:
The object will not be actually disposed by calls to IDisposable when there is at least one strong reference left. Code that calls this method is responsible for calling the IDisposable method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Using this method usually requires type casting. Subclasses may additionally implement IDisposableGeneric, in order to provide some syntactic sugar for that.
Acquires a strong reference to this disposable object.
[OwnerReturn, Pure]
|
||||
public
method
|
AcquireThrow
()
|
|||
type
|
IDisposable
|
|||
returns
|
|
The strong reference to this disposable object. | ||
inherited
|
Disposable.AcquireThrow
|
Remarks:
The object will not be actually disposed by calls to IDisposable when there is at least one strong reference left. Code that calls this method is responsible for calling the IDisposable method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Exceptions:
Clears all cached pyramid tile data from the cache.
[ThreadSafe]
|
||||
public
method
|
Clear
()
|
Exceptions:
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Implementing methods must not throw any exceptions.
Flushes all cached data.
public
method
|
Flush
()
|
||
implements
|
IFlushable.Flush
|
Remarks:
Performing
a
flush
may
result
in
I/O
work.
Depending
on
the
semantics
of
the
implementing
class,
this
work
may
need
to
be
wrapped
in
special
Begin
/End
method
calls.
See
the
documentation
of
the
implementing
classes
for
details.
In case this object represents a read-only resource, calling the Flush method has no effect.
Exceptions: