Last active
November 6, 2020 18:45
-
-
Save ajdavis/8e470cea9daccb740936f2554314d312 to your computer and use it in GitHub Desktop.
Generated classes for generic args/fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WARNING: This is a generated file. Do not modify. | |
* | |
* Source: buildscripts/idl/idlc.py --include src --base_dir build/mac --target_arch x86_64 --header build/mac/mongo/idl/generic_argument_gen.h --output build/mac/mongo/idl/generic_argument_gen.cpp src/mongo/idl/generic_argument.idl | |
*/ | |
#include "mongo/platform/basic.h" | |
#include "mongo/idl/generic_argument_gen.h" | |
#include <bitset> | |
#include <set> | |
#include "mongo/bson/bsonobjbuilder.h" | |
#include "mongo/db/commands.h" | |
#include "mongo/idl/command_generic_argument.h" | |
namespace mongo { | |
// Map: fieldName -> shouldForwardToShards | |
const stdx::unordered_map<std::string, bool> Generic_args_api_v1::_genericFields { | |
{"$clusterTime", false}, | |
{"$db", false}, | |
{"$readPreference", false}, | |
{"apiDeprecationErrors", false}, | |
{"apiStrict", false}, | |
{"apiVersion", false}, | |
{"autocommit", true}, | |
{"clientOperationKey", true}, | |
{"comment", true}, | |
{"lsid", true}, | |
{"maxTimeMS", true}, | |
{"readConcern", true}, | |
{"startTransaction", true}, | |
{"stmtId", true}, | |
{"txnNumber", true}, | |
{"writeConcern", true}, | |
}; | |
bool Generic_args_api_v1::hasField(StringData fieldName) { | |
return _genericFields.find(fieldName.toString()) != _genericFields.end(); | |
} | |
bool Generic_args_api_v1::shouldForwardToShards(StringData fieldName) { | |
auto it = _genericFields.find(fieldName.toString()); | |
return (it == _genericFields.end() || it->second); | |
} | |
// Map: fieldName -> shouldForwardToShards | |
const stdx::unordered_map<std::string, bool> Generic_args_unstable_v1::_genericFields { | |
{"$audit", false}, | |
{"$client", false}, | |
{"$configServerState", false}, | |
{"$configTime", false}, | |
{"$oplogQueryData", false}, | |
{"$queryOptions", true}, | |
{"$replData", false}, | |
{"$topologyTime", false}, | |
{"allowImplicitCollectionCreation", false}, | |
{"coordinator", true}, | |
{"databaseVersion", false}, | |
{"maxTimeMSOpOnly", false}, | |
{"operationTime", true}, | |
{"shardVersion", false}, | |
{"tracking_info", false}, | |
}; | |
bool Generic_args_unstable_v1::hasField(StringData fieldName) { | |
return _genericFields.find(fieldName.toString()) != _genericFields.end(); | |
} | |
bool Generic_args_unstable_v1::shouldForwardToShards(StringData fieldName) { | |
auto it = _genericFields.find(fieldName.toString()); | |
return (it == _genericFields.end() || it->second); | |
} | |
// Map: fieldName -> shouldForwardFromShards | |
const stdx::unordered_map<std::string, bool> Generic_reply_fields_api_v1::_genericFields { | |
{"$clusterTime", false}, | |
{"operationTime", false}, | |
}; | |
bool Generic_reply_fields_api_v1::hasField(StringData fieldName) { | |
return _genericFields.find(fieldName.toString()) != _genericFields.end(); | |
} | |
bool Generic_reply_fields_api_v1::shouldForwardFromShards(StringData fieldName) { | |
auto it = _genericFields.find(fieldName.toString()); | |
return (it == _genericFields.end() || it->second); | |
} | |
// Map: fieldName -> shouldForwardFromShards | |
const stdx::unordered_map<std::string, bool> Generic_reply_fields_unstable_v1::_genericFields { | |
{"$configServerState", true}, | |
{"$configTime", false}, | |
{"$gleStats", false}, | |
{"$replData", false}, | |
{"$topologyTime", false}, | |
{"lastCommittedOpTime", false}, | |
{"readOnly", false}, | |
}; | |
bool Generic_reply_fields_unstable_v1::hasField(StringData fieldName) { | |
return _genericFields.find(fieldName.toString()) != _genericFields.end(); | |
} | |
bool Generic_reply_fields_unstable_v1::shouldForwardFromShards(StringData fieldName) { | |
auto it = _genericFields.find(fieldName.toString()); | |
return (it == _genericFields.end() || it->second); | |
} | |
} // namespace mongo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WARNING: This is a generated file. Do not modify. | |
* | |
* Source: buildscripts/idl/idlc.py --include src --base_dir build/mac --target_arch x86_64 --header build/mac/mongo/idl/generic_argument_gen.h --output build/mac/mongo/idl/generic_argument_gen.cpp src/mongo/idl/generic_argument.idl | |
*/ | |
#pragma once | |
#include <algorithm> | |
#include <boost/optional.hpp> | |
#include <cstdint> | |
#include <string> | |
#include <tuple> | |
#include <vector> | |
#include "mongo/base/data_range.h" | |
#include "mongo/base/string_data.h" | |
#include "mongo/bson/bsonobj.h" | |
#include "mongo/bson/bsonobjbuilder.h" | |
#include "mongo/bson/simple_bsonobj_comparator.h" | |
#include "mongo/idl/idl_parser.h" | |
#include "mongo/rpc/op_msg.h" | |
#include "mongo/stdx/unordered_map.h" | |
namespace mongo { | |
/** | |
* Arguments accepted by all commands. These are guaranteed backwards-compatible for as long as the server supports API Version 1. | |
*/ | |
class Generic_args_api_v1 { | |
public: | |
static bool hasField(StringData fieldName); | |
static bool shouldForwardToShards(StringData fieldName); | |
private: | |
// Map: fieldName -> shouldForwardToShards | |
static const stdx::unordered_map<std::string, bool> _genericFields; | |
}; | |
/** | |
* Arguments accepted by all commands. These are not guaranteed backwards-compatible. | |
*/ | |
class Generic_args_unstable_v1 { | |
public: | |
static bool hasField(StringData fieldName); | |
static bool shouldForwardToShards(StringData fieldName); | |
private: | |
// Map: fieldName -> shouldForwardToShards | |
static const stdx::unordered_map<std::string, bool> _genericFields; | |
}; | |
/** | |
* Fields that may appear in any command reply. These are guaranteed backwards-compatible for as long as the server supports API Version 1. | |
*/ | |
class Generic_reply_fields_api_v1 { | |
public: | |
static bool hasField(StringData fieldName); | |
static bool shouldForwardFromShards(StringData fieldName); | |
private: | |
// Map: fieldName -> shouldForwardFromShards | |
static const stdx::unordered_map<std::string, bool> _genericFields; | |
}; | |
/** | |
* Fields that may appear in any command reply. These are not guaranteed backwards-compatible. | |
*/ | |
class Generic_reply_fields_unstable_v1 { | |
public: | |
static bool hasField(StringData fieldName); | |
static bool shouldForwardFromShards(StringData fieldName); | |
private: | |
// Map: fieldName -> shouldForwardFromShards | |
static const stdx::unordered_map<std::string, bool> _genericFields; | |
}; | |
} // namespace mongo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment