summaryrefslogtreecommitdiff
path: root/src/mongo/idl/basic_types.idl
blob: 76438ecc01f74965ea13d14fd1e4f039fd1eff69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or  modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# IDL Basic Types
global:
    cpp_namespace: "mongo"
        
types:
    string:
        bson_serialization_type: string
        description: "A BSON UTF-8 string"
        cpp_type: "std::string"
        deserializer: "mongo::BSONElement::str"

    int:
        bson_serialization_type: int
        description: "A BSON 32-bit integer"
        cpp_type: "std::int32_t"
        deserializer: "mongo::BSONElement::_numberInt"

    long:
        bson_serialization_type: long
        description: "A BSON 64-bit integer"
        cpp_type: "std::int64_t"
        deserializer: "mongo::BSONElement::_numberLong"

    double:
        bson_serialization_type: double
        description: "A BSON 64-bit floating point number"
        cpp_type: "double"
        deserializer: "mongo::BSONElement::_numberDouble"

    decimal:
        bson_serialization_type: double
        description: "A BSON 128-bit floating point decimal number"
        cpp_type: "mongo::Decimal128"
        deserializer: "mongo::BSONElement::_numberDecimal"

    bool:
        bson_serialization_type: bool
        description: "A BSON bool"
        cpp_type: "bool"
        deserializer: "mongo::BSONElement::boolean"

    # TODO: support bindata
    # bindata:
    #     bson_serialization_type: bindata
    #     cpp_type: "std:"
    #     deserializer: "mongo::BSONElement::str"

    objectid:
        bson_serialization_type: objectid
        description: "A BSON ObjectID"
        cpp_type: "mongo::OID"
        deserializer: "mongo::BSONElement::OID"

    object:
        bson_serialization_type: object
        description: "A BSONObj without custom deserialization or serialization"
        cpp_type: "mongo::BSONObj"

    date:
        bson_serialization_type: date
        description: "A BSON UTC DateTime"
        cpp_type: "mongo::Date_t"
        deserializer: "mongo::BSONElement::date"

    timestamp:
        bson_serialization_type: timestamp
        description: "A BSON TimeStamp"
        cpp_type: "mongo::Timestamp"
        deserializer: "mongo::BSONElement::timestamp"