Coverage Report

Created: 2024-09-08 06:41

/src/alembic/lib/Alembic/Abc/IArchive.cpp
Line
Count
Source (jump to first uncovered line)
1
//-*****************************************************************************
2
//
3
// Copyright (c) 2009-2011,
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
#include <Alembic/Abc/IArchive.h>
38
#include <Alembic/Abc/IObject.h>
39
40
namespace Alembic {
41
namespace Abc {
42
namespace ALEMBIC_VERSION_NS {
43
44
//-*****************************************************************************
45
IArchive::~IArchive()
46
542
{
47
    // Nothing - just here as a support entry point for debugging
48
542
}
49
50
//-*****************************************************************************
51
std::string IArchive::getName() const
52
69
{
53
138
    ALEMBIC_ABC_SAFE_CALL_BEGIN(
54
138
        "IArchive::getName()" );
55
56
138
    return m_archive->getName();
57
58
138
    ALEMBIC_ABC_SAFE_CALL_END();
59
60
    // Not all error handlers throw,
61
    // so return a NO-OP value
62
0
    return "";
63
69
}
64
65
//-*****************************************************************************
66
IObject IArchive::getTop() const
67
69
{
68
138
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive::getTop()" );
69
70
138
    return IObject( m_archive->getTop() );
71
72
138
    ALEMBIC_ABC_SAFE_CALL_END();
73
74
    // Not all error handlers throw, so here is a default behavior.
75
0
    return IObject();
76
69
}
77
78
//-*****************************************************************************
79
AbcA::ReadArraySampleCachePtr IArchive::getReadArraySampleCachePtr()
80
0
{
81
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive::getReadArraySampleCachePtr" );
82
83
0
    return m_archive->getReadArraySampleCachePtr();
84
85
0
    ALEMBIC_ABC_SAFE_CALL_END();
86
87
    // Not all error handlers throw,
88
    // so return a NO-OP value.
89
0
    return AbcA::ReadArraySampleCachePtr();
90
0
}
91
92
//-*****************************************************************************
93
AbcA::TimeSamplingPtr IArchive::getTimeSampling( uint32_t iIndex )
94
0
{
95
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive:::getTimeSampling" );
96
97
0
    return m_archive->getTimeSampling( iIndex );
98
99
0
    ALEMBIC_ABC_SAFE_CALL_END();
100
101
    // Not all error handlers throw, so here is a default behavior.
102
0
    return AbcA::TimeSamplingPtr();
103
0
}
104
105
//-*****************************************************************************
106
uint32_t IArchive::getNumTimeSamplings( )
107
0
{
108
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive:::getNumTimeSampling" );
109
110
0
    return m_archive->getNumTimeSamplings( );
111
112
0
    ALEMBIC_ABC_SAFE_CALL_END();
113
114
    // Not all error handlers throw, so here is a default behavior.
115
0
    return 0;
116
0
}
117
118
//-*****************************************************************************
119
index_t IArchive::getMaxNumSamplesForTimeSamplingIndex( uint32_t iIndex )
120
0
{
121
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN(
122
0
        "IArchive::getMaxNumSamplesForTimeSamplingIndex" );
123
124
0
    return m_archive->getMaxNumSamplesForTimeSamplingIndex( iIndex );
125
126
0
    ALEMBIC_ABC_SAFE_CALL_END();
127
128
    // Not all error handlers throw, so here is a default behavior.
129
0
    return INDEX_UNKNOWN;
130
0
}
131
132
//-*****************************************************************************
133
int32_t IArchive::getArchiveVersion( )
134
0
{
135
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive:::getArchiveVersion" );
136
137
0
    return m_archive->getArchiveVersion( );
138
139
0
    ALEMBIC_ABC_SAFE_CALL_END();
140
141
    // Not all error handlers throw, so here is a default behavior.
142
0
    return 0;
143
0
}
144
145
//-*****************************************************************************
146
void IArchive::setReadArraySampleCachePtr( AbcA::ReadArraySampleCachePtr iPtr )
147
0
{
148
0
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IArchive::setReadArraySampleCachePtr" );
149
150
0
    m_archive->setReadArraySampleCachePtr( iPtr );
151
152
0
    ALEMBIC_ABC_SAFE_CALL_END();
153
0
}
154
155
} // End namespace ALEMBIC_VERSION_NS
156
} // End namespace Abc
157
} // End namespace Alembic