# DXGfxLib.RessourceManager Class Reference

At the moment this class is only use to control that we load a MeshRessource only once. This is not completely fnished yet, for example there is no usage ref count. This will be implemented once I have decided if the library will start managing ressources or if these should always be managed by the calling code and that the library should remain only a scene graph libary. This is still undecided. More...

Collaboration diagram for DXGfxLib.RessourceManager:

[legend]

List of all members.

## Public Member Functions
| RessourceManager ()
| Default constructor. The constructor check if the member variable globalInstance is already different of null. If it is the constructor will throw an exception to notify the calling code!!
RessourceManager | GetGlobalInstance ()
| This static method will always return a reference to the sole instance of this class. If the constructor has not been called yet and that we don't have any instance of the RessourceManager class we throw an exception.
MeshRessource | GetMeshRessource (string filename)
| This method will check if the specified filename has already been loaded in a MeshRessource. If it has we get its reference and return that to the calling code. If it has not been loaded yet the method is going to load it now and add the fileName and a ref to the MeshRessource to the HAshtable loadedMeshRessources. If one day MeshRessource or a base Ressource class do implement a usage counter ala COM ref count then this method will have to increase the ref count if the ressource is already loaded and that a ref to the already existing MeshRessource is return to the calling code.
| RessourceManager ()
| Default constructor. The constructor check if the member variable globalInstance is already different of null. If it is the constructor will throw an exception to notify the calling code!!
RessourceManager | GetGlobalInstance ()
| This static method will always return a reference to the sole instance of this class. If the constructor has not been called yet and that we don't have any instance of the RessourceManager class we throw an exception.
MeshRessource | GetMeshRessource (string filename)
| This method will check if the specified filename has already been loaded in a MeshRessource. If it has we get its reference and return that to the calling code. If it has not been loaded yet the method is going to load it now and add the fileName and a ref to the MeshRessource to the HAshtable loadedMeshRessources. If one day MeshRessource or a base Ressource class do implement a usage counter ala COM ref count then this method will have to increase the ref count if the ressource is already loaded and that a ref to the already existing MeshRessource is return to the calling code.
## Static Protected Attributes
static RessourceManager | globalInstance = null
| At the moment we want only one instance of the RessourceManager class per AppDomain so we keep a ref to the first instance created here. When the constructore is called if this static member variable is not null we just throw an exception.

## Detailed Description

At the moment this class is only use to control that we load a MeshRessource only once. This is not completely fnished yet, for example there is no usage ref count. This will be implemented once I have decided if the library will start managing ressources or if these should always be managed by the calling code and that the library should remain only a scene graph libary. This is still undecided.

Definition at line 14 of file RessourceManager.cs.

## Constructor & Destructor Documentation

DXGfxLib.RessourceManager.RessourceManager | ( |  | ) |

Default constructor. The constructor check if the member variable globalInstance is already different of null. If it is the constructor will throw an exception to notify the calling code!!

Definition at line 32 of file RessourceManager.cs.

DXGfxLib.RessourceManager.RessourceManager | ( |  | ) |

Default constructor. The constructor check if the member variable globalInstance is already different of null. If it is the constructor will throw an exception to notify the calling code!!

Definition at line 32 of file RessourceManager.cs.

## Member Function Documentation

RessourceManager DXGfxLib.RessourceManager.GetGlobalInstance | ( |  | ) |

This static method will always return a reference to the sole instance of this class. If the constructor has not been called yet and that we don't have any instance of the RessourceManager class we throw an exception.

Returns:

Definition at line 47 of file RessourceManager.cs.

RessourceManager DXGfxLib.RessourceManager.GetGlobalInstance | ( |  | ) |

This static method will always return a reference to the sole instance of this class. If the constructor has not been called yet and that we don't have any instance of the RessourceManager class we throw an exception.

Returns:

Definition at line 47 of file RessourceManager.cs.

MeshRessource DXGfxLib.RessourceManager.GetMeshRessource | ( | string | filename | ) |

This method will check if the specified filename has already been loaded in a MeshRessource. If it has we get its reference and return that to the calling code. If it has not been loaded yet the method is going to load it now and add the fileName and a ref to the MeshRessource to the HAshtable loadedMeshRessources. If one day MeshRessource or a base Ressource class do implement a usage counter ala COM ref count then this method will have to increase the ref count if the ressource is already loaded and that a ref to the already existing MeshRessource is return to the calling code.

Parameters:

  | filename |

Returns:

Definition at line 66 of file RessourceManager.cs.

MeshRessource DXGfxLib.RessourceManager.GetMeshRessource | ( | string | filename | ) |

This method will check if the specified filename has already been loaded in a MeshRessource. If it has we get its reference and return that to the calling code. If it has not been loaded yet the method is going to load it now and add the fileName and a ref to the MeshRessource to the HAshtable loadedMeshRessources. If one day MeshRessource or a base Ressource class do implement a usage counter ala COM ref count then this method will have to increase the ref count if the ressource is already loaded and that a ref to the already existing MeshRessource is return to the calling code.

Parameters:

  | filename |

Returns:

Definition at line 66 of file RessourceManager.cs.

## Member Data Documentation

static RessourceManager DXGfxLib.RessourceManager::globalInstance = null`[static, protected]`

At the moment we want only one instance of the RessourceManager class per AppDomain so we keep a ref to the first instance created here. When the constructore is called if this static member variable is not null we just throw an exception.

Definition at line 21 of file RessourceManager.cs.

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

- D:/guillaume/guillara/3D/DXGfx/Backup/DXGfxLib/RessourceManager.cs
- D:/guillaume/guillara/3D/DXGfx/DXGfxLib/RessourceManager.cs