Loading...
Searching...
No Matches
IFactory.h
Go to the documentation of this file.
//-*****************************************************************************
//
// Copyright (c) 2013-2015,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//-*****************************************************************************
#ifndef Alembic_AbcCoreFactory_IFactory_h
#define Alembic_AbcCoreFactory_IFactory_h
#include <Alembic/AbcCoreAbstract/ReadArraySampleCache.h>
#include <Alembic/Abc/IArchive.h>
#include <Alembic/Util/Export.h>
namespace Alembic {
namespace AbcCoreFactory {
namespace ALEMBIC_VERSION_NS {
class ALEMBIC_EXPORT IFactory
{
public:
IFactory();
~IFactory();
enum CoreType
{
kHDF5,
kOgawa,
kLayer,
kUnknown
};
Alembic::Abc::IArchive getArchive( const std::string & iFileName,
CoreType & oType );
Alembic::Abc::IArchive getArchive( const std::string & iFileName );
Alembic::Abc::IArchive getArchive(
const std::vector< std::string > & iFileNames );
Alembic::Abc::IArchive getArchive(
const std::vector< std::string > & iFileNames, CoreType & oType );
Alembic::Abc::IArchive getArchive(
const std::vector< std::istream * > & iStreams, CoreType & oType );
// TODO, how do we best layer streams, and strings
void setHDF5CacheHierarchy( bool iCacheHierarchy )
{
m_cacheHierarchy = iCacheHierarchy;
}
bool getHDF5CacheHierarchy() const { return m_cacheHierarchy; }
void setSampleCache(
Alembic::AbcCoreAbstract::ReadArraySampleCachePtr iCachePtr )
{
m_cachePtr = iCachePtr;
}
Alembic::AbcCoreAbstract::ReadArraySampleCachePtr getSampleCache() const
{
return m_cachePtr;
}
size_t getOgawaNumStreams() const { return m_numStreams; }
void setOgawaNumStreams( size_t iNumStreams )
{
m_numStreams = iNumStreams;
}
enum OgawaReadStrategy
{
kFileStreams,
kMemoryMappedFiles
};
OgawaReadStrategy getOgawaReadStrategy() { return m_readStrategy; }
void setOgawaReadStrategy( OgawaReadStrategy iStrategy )
{
m_readStrategy = iStrategy;
}
Alembic::Abc::ErrorHandler::Policy getPolicy() { return m_policy; }
void setPolicy( Alembic::Abc::ErrorHandler::Policy iPolicy )
{
m_policy = iPolicy;
}
private:
bool m_cacheHierarchy;
size_t m_numStreams;
OgawaReadStrategy m_readStrategy;
Alembic::AbcCoreAbstract::ReadArraySampleCachePtr m_cachePtr;
Alembic::Abc::ErrorHandler::Policy m_policy;
};
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace Abc
} // End namespace Alembic
#endif
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition Export.h:51
IArchive.h
ReadArraySampleCache.h
ALEMBIC_VERSION_NS
#define ALEMBIC_VERSION_NS
Definition Foundation.h:105
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::setSampleCache
void setSampleCache(Alembic::AbcCoreAbstract::ReadArraySampleCachePtr iCachePtr)
Set the array sample cache, the HDF5 implementation optionally uses this.
Definition IFactory.h:103
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getOgawaNumStreams
size_t getOgawaNumStreams() const
Definition IFactory.h:117
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getOgawaReadStrategy
OgawaReadStrategy getOgawaReadStrategy()
Get the I/O strategy used for reading Ogawa files.
Definition IFactory.h:133
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getSampleCache
Alembic::AbcCoreAbstract::ReadArraySampleCachePtr getSampleCache() const
Get the array sample cache.
Definition IFactory.h:110
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::CoreType
CoreType
The type which yielded a valid IArchive (or kUnknown if invalid)
Definition IFactory.h:56
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kHDF5
@ kHDF5
Definition IFactory.h:57
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kOgawa
@ kOgawa
Definition IFactory.h:58
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kUnknown
@ kUnknown
Definition IFactory.h:60
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kLayer
@ kLayer
Definition IFactory.h:59
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::IFactory
IFactory()
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getArchive
Alembic::Abc::IArchive getArchive(const std::vector< std::string > &iFileNames, CoreType &oType)
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getHDF5CacheHierarchy
bool getHDF5CacheHierarchy() const
Gets whether an HDF5 file will use the cached hierarchy.
Definition IFactory.h:100
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::~IFactory
~IFactory()
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getPolicy
Alembic::Abc::ErrorHandler::Policy getPolicy()
Gets the error handler policy.
Definition IFactory.h:144
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::setOgawaReadStrategy
void setOgawaReadStrategy(OgawaReadStrategy iStrategy)
Definition IFactory.h:137
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getArchive
Alembic::Abc::IArchive getArchive(const std::string &iFileName)
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::setPolicy
void setPolicy(Alembic::Abc::ErrorHandler::Policy iPolicy)
Sets the error handler policy, the default is kThrowPolicy.
Definition IFactory.h:147
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getArchive
Alembic::Abc::IArchive getArchive(const std::vector< std::string > &iFileNames)
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::setOgawaNumStreams
void setOgawaNumStreams(size_t iNumStreams)
Definition IFactory.h:121
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getArchive
Alembic::Abc::IArchive getArchive(const std::string &iFileName, CoreType &oType)
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::setHDF5CacheHierarchy
void setHDF5CacheHierarchy(bool iCacheHierarchy)
Definition IFactory.h:94
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::getArchive
Alembic::Abc::IArchive getArchive(const std::vector< std::istream * > &iStreams, CoreType &oType)
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::OgawaReadStrategy
OgawaReadStrategy
Definition IFactory.h:127
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kFileStreams
@ kFileStreams
Definition IFactory.h:128
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS::IFactory::kMemoryMappedFiles
@ kMemoryMappedFiles
Definition IFactory.h:129
Alembic::Abc::ALEMBIC_VERSION_NS::IArchive
Definition IArchive.h:53
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ReadArraySampleCachePtr
Alembic::Util::shared_ptr< ReadArraySampleCache > ReadArraySampleCachePtr
Definition ReadArraySampleCache.h:138
Alembic::AbcCoreFactory::ALEMBIC_VERSION_NS
Definition IFactory.h:46
Alembic::AbcCoreFactory
Definition IFactory.h:45
Alembic
Alembic namespace ...
Definition ArchiveInfo.h:46