Abstract base class for IModelReader implementations.
abstract class
|
ModelReaderBase
|
extends
|
Disposable
|
||
implements
|
IModelReader
|
||||
base of
|
ModelReader
|
Returns the configuration value that describes this object.
public
abstract
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
overrides
|
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 file data from which to read the 3D model.
protected
field
|
data
|
||
type
|
IFileData
|
Creates a new instance of ModelReaderBase.
protected
constructor
|
ModelReaderBase
(IFileData data)
|
||
params
|
data
|
[not-null]
|
The file data from which to read the 3D model. |
Subclasses must call this method when the model reader options have been modified.
protected
method
|
Dirty
()
|
Disposes the resources held by a concrete subclass. This method will be called exactly once per instance.
protected
override
method
|
DisposeResources
()
|
||
overrides
|
Disposable.DisposeResources
|
Remarks:
This method will be called as soon as all ownership references to this instance have been relinquished by calls to the Dispose method.
The system may garbage collect an instance of IDisposable iff there are no more references to it. In this case, the DisposeResources will be called, in order to avoid dangling resources. However, it is not advisable to rely on the garbage collection of the system, as the behaviour may differ significantly between environments. Instead, ownership rules should be obeyed, which effectively removes the need for automatic garbage collection.
Overriding methods must call the DisposeResources method of their base class. The base call should be the last statement.
Reads the 3D model.
protected
abstract
method
|
DoReadModel
()
|
||
type
|
IModel
|
||
returns
|
|
The read 3D model. |
Exceptions:
Begins to initialize this object.
protected
method
|
InitializeBegin
()
|
||
type
|
bool
|
||
returns
|
true
if
initialization
must
be
performed,
false
if
initialization
has
already
been
performed.
|
||
inherited
|
Disposable.InitializeBegin
|
Has this object been initialized?
protected
method
|
InitializeRequired
()
|
||
type
|
bool
|
||
returns
|
true
if
Initialize
has
already
been
called,
false
if
not.
|
||
inherited
|
Disposable.InitializeRequired
|
Flushes cached validation data.
[EmptyBody]
|
||||
protected
virtual
method
|
ValidateFlush
()
|
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
|
Acquires a strong reference to this disposable object.
[OwnerReturn, Pure]
|
||||
public
method
|
Acquire
()
|
|||
type
|
IModelReader
|
|||
returns
|
The
strong
reference
to
this
disposable
object
or
null
iff
this
object
is
no
longer
valid.
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls this method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
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:
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.
Reads the 3D model using the current options.
public
method
|
ReadModel
()
|
||
type
|
IModel
|
||
returns
|
|
The read 3D model. | |
implements
|
IModelReader.ReadModel
|
Remarks:
When the ReadModel method is called multiple times, the same IModel object will be returned, unless the model reader options have been modified.
Exceptions:
Validates the state of this object.
public
virtual
method
|
Validate
(Validator validator)
|
||
params
|
validator
|
[not-null]
|
The validator object. |
implements
|
IValidatable.Validate
|