VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties
VisimBox.Resources.Resource< T > Class Template Reference

Class for wrapping generic resources. More...

Inheritance diagram for VisimBox.Resources.Resource< T >:

List of all members.

## Public Member Functions
| Resource (T data)
virtual void | AddReference (IResourceConsumer consumer)
| Adds reference to this resource.
virtual void | RemoveReference (IResourceConsumer consumer)
| Removes reference to this resource.
virtual bool | ReplaceReferences (IResource newresource)
| Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.
virtual void | Dispose ()
## Protected Member Functions
| Resource ()
## Protected Attributes
T | _data
string | _filename
List< IResourceConsumer > | Consumers = new List<IResourceConsumer>()
## Properties
virtual T | Data`[get]`
virtual bool | AlwaysStay`[get, set]`
| If true, resource will stay in memory even if it's not referenced.
virtual ResourceType | ResourceType`[get]`
| Generic type of the resource.
virtual ResourceUsage | Usage`[get]`
| Type of the resource usage (static/dynamic)
virtual string | FileName`[get, set]`
| File used to create the resource (if it was loaded from the disk)
int | References`[get]`
| Number of current references.
int | NullReferences`[get]`
| Returns number of null generic references.

## Detailed Description

### template<T>
class VisimBox::Resources::Resource< T >

Class for wrapping generic resources.

Template Parameters:

  T |

## Member Function Documentation

template<T >

virtual void VisimBox.Resources.Resource< T >.AddReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Adds reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

template<T >

virtual void VisimBox.Resources.Resource< T >.Dispose | ( |  | ) | `[virtual]`

template<T >

virtual void VisimBox.Resources.Resource< T >.RemoveReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Removes reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

template<T >

virtual bool VisimBox.Resources.Resource< T >.ReplaceReferences | ( | IResource | newresource | ) | `[virtual]`

Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.

Parameters:

  newresource | New resource

Returns:
  True if resource is compatible type and all consumers accepted resource changing, false otherwise

Implements VisimBox.Resources.IResource.

template<T >

VisimBox.Resources.Resource< T >.Resource | ( |  | ) | `[protected]`

template<T >

VisimBox.Resources.Resource< T >.Resource | ( | T | data | ) |

## Member Data Documentation

template<T >

T VisimBox.Resources.Resource< T >._data`[protected]`

template<T >

string VisimBox.Resources.Resource< T >._filename`[protected]`

template<T >

List<IResourceConsumer> VisimBox.Resources.Resource< T >.Consumers = new List<IResourceConsumer>()`[protected]`

## Property Documentation

template<T >

virtual bool VisimBox.Resources.Resource< T >.AlwaysStay`[get, set]`

If true, resource will stay in memory even if it's not referenced.

Implements VisimBox.Resources.IResource.

template<T >

virtual T VisimBox.Resources.Resource< T >.Data`[get]`

template<T >

virtual string VisimBox.Resources.Resource< T >.FileName`[get, set]`

File used to create the resource (if it was loaded from the disk)

Implements VisimBox.Resources.IResource.

template<T >

int VisimBox.Resources.Resource< T >.NullReferences`[get]`

Returns number of null generic references.

Implements VisimBox.Resources.IResource.

template<T >

int VisimBox.Resources.Resource< T >.References`[get]`

Number of current references.

Implements VisimBox.Resources.IResource.

template<T >

virtual ResourceType VisimBox.Resources.Resource< T >.ResourceType`[get]`

Generic type of the resource.

Implements VisimBox.Resources.IResource.

Reimplemented in VisimBox.Resources.GenericResource, and VisimBox.Resources.StringTableResource.

template<T >

virtual ResourceUsage VisimBox.Resources.Resource< T >.Usage`[get]`

Type of the resource usage (static/dynamic)

Implements VisimBox.Resources.IResource.

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

- ResourceManagers.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events