Alembic Version 1.1
IFactory.h
Go to the documentation of this file.
1//-*****************************************************************************
2//
3// Copyright (c) 2013-2015,
4// Sony Pictures Imageworks, Inc. and
5// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
6//
7// All rights reserved.
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12// * Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14// * Redistributions in binary form must reproduce the above
15// copyright notice, this list of conditions and the following disclaimer
16// in the documentation and/or other materials provided with the
17// distribution.
18// * Neither the name of Sony Pictures Imageworks, nor
19// Industrial Light & Magic nor the names of their contributors may be used
20// to endorse or promote products derived from this software without specific
21// prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35//-*****************************************************************************
36
37#ifndef Alembic_AbcCoreFactory_IFactory_h
38#define Alembic_AbcCoreFactory_IFactory_h
39
42#include <Alembic/Util/Export.h>
43
44namespace Alembic {
45namespace AbcCoreFactory {
47
49{
50public:
53
56 {
60 kUnknown
61 };
62
65 Alembic::Abc::IArchive getArchive( const std::string & iFileName,
66 CoreType & oType );
67
70 Alembic::Abc::IArchive getArchive( const std::string & iFileName );
71
75 const std::vector< std::string > & iFileNames );
76
82 const std::vector< std::string > & iFileNames, CoreType & oType );
83
88 const std::vector< std::istream * > & iStreams, CoreType & oType );
89
90 // TODO, how do we best layer streams, and strings
91
94 void setHDF5CacheHierarchy( bool iCacheHierarchy )
95 {
96 m_cacheHierarchy = iCacheHierarchy;
97 }
98
100 bool getHDF5CacheHierarchy() const { return m_cacheHierarchy; }
101
105 {
106 m_cachePtr = iCachePtr;
107 }
108
111 {
112 return m_cachePtr;
113 }
114
117 size_t getOgawaNumStreams() const { return m_numStreams; }
118
121 void setOgawaNumStreams( size_t iNumStreams )
122 {
123 m_numStreams = iNumStreams;
124 }
125
127 {
129 kMemoryMappedFiles
130 };
131
133 OgawaReadStrategy getOgawaReadStrategy() { return m_readStrategy; }
134
138 {
139 m_readStrategy = iStrategy;
140 }
141
142
145
148 {
149 m_policy = iPolicy;
150 }
151
152private:
153 bool m_cacheHierarchy;
154 size_t m_numStreams;
155 OgawaReadStrategy m_readStrategy;
158
159};
160
161} // End namespace ALEMBIC_VERSION_NS
162
163using namespace ALEMBIC_VERSION_NS;
164
165} // End namespace Abc
166} // End namespace Alembic
167
168#endif
#define ALEMBIC_EXPORT
Definition: Export.h:51
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
void setSampleCache(Alembic::AbcCoreAbstract::ReadArraySampleCachePtr iCachePtr)
Set the array sample cache, the HDF5 implementation optionally uses this.
Definition: IFactory.h:103
OgawaReadStrategy getOgawaReadStrategy()
Get the I/O strategy used for reading Ogawa files.
Definition: IFactory.h:133
Alembic::AbcCoreAbstract::ReadArraySampleCachePtr getSampleCache() const
Get the array sample cache.
Definition: IFactory.h:110
CoreType
The type which yielded a valid IArchive (or kUnknown if invalid)
Definition: IFactory.h:56
Alembic::Abc::IArchive getArchive(const std::vector< std::string > &iFileNames, CoreType &oType)
bool getHDF5CacheHierarchy() const
Gets whether an HDF5 file will use the cached hierarchy.
Definition: IFactory.h:100
Alembic::Abc::ErrorHandler::Policy getPolicy()
Gets the error handler policy.
Definition: IFactory.h:144
void setOgawaReadStrategy(OgawaReadStrategy iStrategy)
Definition: IFactory.h:137
Alembic::Abc::IArchive getArchive(const std::string &iFileName)
void setPolicy(Alembic::Abc::ErrorHandler::Policy iPolicy)
Sets the error handler policy, the default is kThrowPolicy.
Definition: IFactory.h:147
Alembic::Abc::IArchive getArchive(const std::vector< std::string > &iFileNames)
Alembic::Abc::IArchive getArchive(const std::string &iFileName, CoreType &oType)
void setHDF5CacheHierarchy(bool iCacheHierarchy)
Definition: IFactory.h:94
Alembic::Abc::IArchive getArchive(const std::vector< std::istream * > &iStreams, CoreType &oType)
Alembic::Util::shared_ptr< ReadArraySampleCache > ReadArraySampleCachePtr
Alembic namespace ...
Definition: ArchiveInfo.h:46