- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDPlaceHolder.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008
    00014 #ifndef _FCD_PLACEHOLDER_H_
    00015 #define _FCD_PLACEHOLDER_H_
    00016
    00017 #ifndef __FCD_OBJECT_H_
    00018 #include "FCDocument/FCDObject.h"
    00019 #endif // __FCD_OBJECT_H_
    00020
    00021 class FCDEntityReference;
    00022
    00033 class FCOLLADA_EXPORT FCDPlaceHolder : public FCDObject, FUTracker
    00034 {
    00035 private:
    00036     DeclareObjectType(FCDPlaceHolder);
    00037
    00038     FCDocument* target;
    00039     FUTrackedList<FCDEntityReference> references;
    00040     fstring fileUrl;
    00041
    00042 public:
    00046     FCDPlaceHolder(FCDocument* document, FCDocument* target = NULL);
    00047
    00049     virtual ~FCDPlaceHolder();
    00050
    00054     inline FCDocument* GetTarget() const { return target; }
    00055
    00061     FCDocument* GetTarget(bool loadIfMissing = true);
    00062
    00067     void LoadTarget(FCDocument* _target = NULL);
    00068
    00070     void UnloadTarget();
    00071
    00075     inline bool IsTargetLoaded() const { return target != NULL; }
    00076
    00079     const fstring& GetFileUrl() const;
    00080
    00083     void SetFileUrl(const fstring& url);
    00084
    00089     inline void AddExternalReference(FCDEntityReference* reference) { references.push_back(reference); SetNewChildFlag(); }
    00090
    00094     inline void RemoveExternalReference(FCDEntityReference* reference) { references.erase(reference); SetNewChildFlag(); }
    00095
    00099     inline size_t GetExternalReferenceCount() const { return references.size(); }
    00100
    00104     const FCDEntityReference* GetExternalReference(size_t index) const { FUAssert(index < GetExternalReferenceCount(), return NULL); return references.at(index); }
    00105
    00106 protected:
    00110     void OnObjectReleased(FUTrackable* object);
    00111 };
    00112
    00113 #endif // _FCD_PLACEHOLDER_H_
    00114