/src/openexr/src/lib/OpenEXR/ImfRationalAttribute.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // SPDX-License-Identifier: BSD-3-Clause |
3 | | // Copyright (c) Contributors to the OpenEXR Project. |
4 | | // |
5 | | |
6 | | //----------------------------------------------------------------------------- |
7 | | // |
8 | | // class RationalAttribute |
9 | | // |
10 | | //----------------------------------------------------------------------------- |
11 | | |
12 | | #define COMPILING_IMF_RATIONAL_ATTRIBUTE |
13 | | |
14 | | #include "ImfRationalAttribute.h" |
15 | | |
16 | | #if defined(_MSC_VER) |
17 | | // suppress warning about non-exported base classes |
18 | | # pragma warning(disable : 4251) |
19 | | # pragma warning(disable : 4275) |
20 | | #endif |
21 | | |
22 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER |
23 | | |
24 | | using namespace OPENEXR_IMF_INTERNAL_NAMESPACE; |
25 | | |
26 | | template <> |
27 | | IMF_EXPORT const char* |
28 | | RationalAttribute::staticTypeName () |
29 | 1 | { |
30 | 1 | return "rational"; |
31 | 1 | } |
32 | | |
33 | | template <> |
34 | | IMF_EXPORT void |
35 | | RationalAttribute::writeValueTo ( |
36 | | OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, int version) const |
37 | 0 | { |
38 | 0 | Xdr::write<StreamIO> (os, _value.n); |
39 | 0 | Xdr::write<StreamIO> (os, _value.d); |
40 | 0 | } |
41 | | |
42 | | template <> |
43 | | IMF_EXPORT void |
44 | | RationalAttribute::readValueFrom ( |
45 | | OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int size, int version) |
46 | 0 | { |
47 | 0 | Xdr::read<StreamIO> (is, _value.n); |
48 | 0 | Xdr::read<StreamIO> (is, _value.d); |
49 | 0 | } |
50 | | |
51 | | template class IMF_EXPORT_TEMPLATE_INSTANCE |
52 | | TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::Rational>; |
53 | | |
54 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT |