DWFToolkit::DWFContentManager Class Reference
[DWF Package API]

#include "dwf/package/ContentManager.h"

Inheritance diagram for DWFToolkit::DWFContentManager:

Inheritance graph
[legend]
Collaboration diagram for DWFToolkit::DWFContentManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is used to manage one or more global content objects.

Since:
7.2.0
This class manages the one or more global contents available in DWF package. The manager also manages the associations between each content and the sections that refer to the content. Even if there are multiple contents one of them will always be considered the primary content of the package. A normalization of the content will merge the multiple contents into the primary content.
Examples:

3DPublish/3DPublish_UTF8.cpp, ReadContentDefinition/ReadContentDefinition.cpp, and WriteContent/WriteContent.cpp.

Definition at line 59 of file ContentManager.h.

Public Member Functions

_DWFTK_API DWFContentManager (DWFPackageReader *pPackageReader=NULL) throw ()
virtual _DWFTK_API ~DWFContentManager () throw ()
_DWFTK_API DWFContent::tMap::Iterator * getContents () throw ()
_DWFTK_API DWFContentgetContent (const DWFString &zContentID=L"") throw ( DWFException )
_DWFTK_API DWFContentgetContentByHREF (const DWFString &zHREF) throw ()
_DWFTK_API size_t getContentCount () const throw ()
_DWFTK_API DWFContentaddContent (const DWFString &zID=L"", DWFPackageReader *pReader=NULL) throw ( DWFException )
_DWFTK_API DWFContentinsertContent (DWFContent *pContent) throw ( DWFException )
_DWFTK_API void removeContents (DWFContent::tList &roRemovedContent) throw ()
_DWFTK_API DWFContentremoveContent (const DWFString &zContentID, const DWFString &zNewPrimaryID=L"", bool bDeleteIfOwned=true) throw ( DWFException )
_DWFTK_API void mergeContent (bool bPrimaryHasPriority=true) throw ()
_DWFTK_API DWFUUIDgetIDProvider () const throw ()
_DWFTK_API void serializeXML (DWFXMLSerializer &rSerializer, unsigned int nFlags) throw ( DWFException )
virtual _DWFTK_API void notifyOwnableDeletion (DWFOwnable &rOwnable) throw ( DWFException )


Constructor & Destructor Documentation

_DWFTK_API DWFToolkit::DWFContentManager::DWFContentManager DWFPackageReader pPackageReader = NULL  )  throw ()
 

Constructor

This constructor is generally only used by the parsing process when the DWFPackageReader associated with (and providing read access to) the DWF package file is available. The subsequent binding makes it possible to read content information from the DWF package.

Parameters:
pPackageReader Provides access to content in the DWF package.
Exceptions:
None 

virtual _DWFTK_API DWFToolkit::DWFContentManager::~DWFContentManager  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFTK_API DWFContent* DWFToolkit::DWFContentManager::addContent const DWFString zID = L"",
DWFPackageReader pReader = NULL
throw ( DWFException )
 

Create a a DWFContent and add it the the list of contents. If an ID is provided this will be the UUID for the content, otherwise the manager will provide one. If this is the first content, it will be set as the primary content. If the content is being added during a read, the content maybe created with a package reader at this point.

Parameters:
zID UUID to be assigned to content.
pReader Pointer to a package reader.
Returns:
A pointer to the newly created DWFContent.
Exceptions:
DWFException 

_DWFTK_API DWFContent* DWFToolkit::DWFContentManager::getContent const DWFString zContentID = L""  )  throw ( DWFException )
 

Get the content by its UUID. If no UUID is provided then the primary content will be returned.

Parameters:
zContentID UUID of the content being requested.
Returns:
A pointer to a content. The pointer maybe NULL if there is no content with the given ID.
Exceptions:
DWFException 
Examples:
3DPublish/3DPublish_UTF8.cpp, ReadContentDefinition/ReadContentDefinition.cpp, and WriteContent/WriteContent.cpp.

_DWFTK_API DWFContent* DWFToolkit::DWFContentManager::getContentByHREF const DWFString zHREF  )  throw ()
 

Get the content with the given HREF.

Parameters:
zHREF The HREF of the content we are looking for.
Returns:
A pointer to the content.
Exceptions:
None 

_DWFTK_API size_t DWFToolkit::DWFContentManager::getContentCount  )  const throw () [inline]
 

Get the number of content libraries

Returns:
The number of contents in the content manager.
Exceptions:
None 

Definition at line 136 of file ContentManager.h.

_DWFTK_API DWFContent::tMap::Iterator* DWFToolkit::DWFContentManager::getContents  )  throw () [inline]
 

Access all managed content via the iterator

Returns:
A pointer to an iterator that must be deleted by the caller with the DWFCORE_FREE_OBJECT macro. This pointer may be NULL.
Exceptions:
None 

Definition at line 100 of file ContentManager.h.

_DWFTK_API DWFUUID* DWFToolkit::DWFContentManager::getIDProvider  )  const throw () [inline]
 

Get the DWFUUID to get a new ID.

Returns:
Pointer to the DWFUUID used by this content manager.
Exceptions:
None 

Definition at line 227 of file ContentManager.h.

_DWFTK_API DWFContent* DWFToolkit::DWFContentManager::insertContent DWFContent pContent  )  throw ( DWFException )
 

Insert a pre-created content into the content manager. This is normally used during the package reading process to reconstruct the content and content manager. Note: Loading from a stream may cause the cotent to already be created. If we have a pre-existing content with the same ID and neither are in a "loaded" state the new one (the one in the argument) will be discarded. Otherwise this keeps the content that is in a loaded state.

Parameters:
pContent The content getting set.
Returns:
A pointer to the inserted content.
Exceptions:
DWFException 

_DWFTK_API void DWFToolkit::DWFContentManager::mergeContent bool  bPrimaryHasPriority = true  )  throw ()
 

Merge the multiple contents into the primary content. This will match the content element UUIDs and drop duplicate elements. If there is only one content this does nothing.

This will destroy all other contents in the content manager.

Parameters:
bPrimaryHasPriority If priority is given to the primary content, in the case of duplicates the elements coming in from other contents will be dropped. If this is false, the content element being merged in will be kept.
Exceptions:
None 

virtual _DWFTK_API void DWFToolkit::DWFContentManager::notifyOwnableDeletion DWFOwnable rOwnable  )  throw ( DWFException ) [virtual]
 

Reimplemented from DWFCore::DWFOwner.

_DWFTK_API DWFContent* DWFToolkit::DWFContentManager::removeContent const DWFString zContentID,
const DWFString zNewPrimaryID = L"",
bool  bDeleteIfOwned = true
throw ( DWFException )
 

Remove completely the specified content. If this is the primary content, another content needs to be set as the primary, if available. If a content ID is provided for the new primary, it will be set as such, otherwise the first one available in the map will be set.

Parameters:
zContentID The ID of the content being removed.
zNewPrimaryID The ID of the conent to be set as primary.
bDeleteIfOwned If true, manager will delete it.
Returns:
Pointer to the returned content. If the deleted internally this will retunr NULL.
Exceptions:
DWFException 

_DWFTK_API void DWFToolkit::DWFContentManager::removeContents DWFContent::tList roRemovedContent  )  throw ()
 

Remove completely all the content owned by the content manager. The content is removed and returned to the caller in the provided container.

Parameters:
roRemovedContent A container of removed contents.
Exceptions:
DWFException 

_DWFTK_API void DWFToolkit::DWFContentManager::serializeXML DWFXMLSerializer rSerializer,
unsigned int  nFlags
throw ( DWFException )
 


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:40:27 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5