1/* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18
19#ifndef OSCL_INT64_UTILS_H_INCLUDED
20#define OSCL_INT64_UTILS_H_INCLUDED
21
22#ifndef OSCL_BASE_H_INCLUDED
23#include "oscl_base.h"
24#endif
25
26//! The Oscl_Int64_Utils class provides a wrapper for commonly used int64/uint64 operations
27/*!
28 * The Oscl_Int64_Utils class:
29 *
30 * Provides a wrapper for commonly used operations to mask the differences between OSes
31 * that have an int64/uint64 class instead of a 64-bit integer.
32 */
33class Oscl_Int64_Utils
34{
35    public:
36        OSCL_IMPORT_REF static void set_int64(int64& input_value, const int32 upper, const int32 lower);
37
38        OSCL_IMPORT_REF static int32 get_int64_upper32(const int64& input_value);
39
40        OSCL_IMPORT_REF static int32 get_int64_lower32(const int64& input_value);
41
42        OSCL_IMPORT_REF static int32 get_int64_middle32(const int64& input_value);
43
44        OSCL_IMPORT_REF static void set_uint64(uint64& input_value, const uint32 upper, const uint32 lower);
45
46        OSCL_IMPORT_REF static uint32 get_uint64_upper32(const uint64& input_value);
47
48        OSCL_IMPORT_REF static uint32 get_uint64_lower32(const uint64& input_value);
49
50        OSCL_IMPORT_REF static uint32 get_uint64_middle32(const uint64& input_value);
51};
52
53/**
54 * OsclInteger64Transport Structure
55 *
56 * Structure to only transport 64-bit integer values
57 * uint64 and int64 could be classes so needed for cases
58 * where having a class will not work.
59 */
60typedef struct OsclInteger64Transport
61{
62    uint32 iHigh;
63    uint32 iLow;
64} _OsclInteger64Transport;
65
66#endif
67
68