Lines Matching full:is
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
24 * Many templates can be customized using field meta data, which is read from
26 * and is concatenated with the elements from the optional fieldMetaData
31 * metadata for a field/method has been found and the default behavior is
32 * used instead. If this version is not defined, the templates just silently
39 // TFieldMeta[]-typed values, but the is() expressions seems to always fail.
54 * Thrift struct/service meta data, which is used to store information from
63 /// Detect the requiredness from the field type: if it is nullable, treat
64 /// the field as optional, if it is non-nullable, treat the field as
65 /// required. This is the default used for handling structs not generated
73 /// The field is treated as optional when deserializing/receiving the struct
74 /// and as required when serializing/sending. This is the Thrift default if
78 /// The field is optional.
81 /// The field is required.
96 /// A fire-and-forget one-way method, where no response is sent and the
112 /// Whether the field is requried.
116 /// is one.
160 /// only serves decorative purposes here, as it is only used in code not
173 * is expected, for specifying different protocols for input and output.
180 * true if T is a TProtocolPair.
183 static if (is(T _ == TProtocolPair!(I, O), I, O)) { in isTProtocolPair()
196 * true if T is a TProtocol or a TProtocolPair.
219 static if(is(T _ == interface) && in isBaseService()
220 (!is(T TBases == super) || TBases.length == 0) in isBaseService()
232 static if(is(T _ == interface) && in isDerivedService()
233 is(T TBases == super) && TBases.length == 1 in isDerivedService()
256 * for which an »is set« flag is needed.
301 * + // f.b is now unset again.
308 * + Returns whether member fieldName is set.
345 * Additionally, an opEquals() implementation is provided which simply
346 * compares all fields, but disregards the is set struct, if any (the exact
348 * metadata is stored in a manifest constant called fieldMeta.
351 * the field metadata, a parameterless static opCall is generated, because D
360 is(typeof(fieldMetaData) : TFieldMeta[])
369 static assert(is(This == struct) || is(This : Exception),
382 is(MemberType!(This, fieldName))
385 static if (is(typeof(mixin("this.isSetFlags." ~ fieldName)) : bool)) {
390 void unset(string fieldName)() if (is(MemberType!(This, fieldName))) {
391 static if (is(typeof(mixin("this.isSetFlags." ~ fieldName)) : bool)) {
398 is(MemberType!(This, fieldName))
401 return __traits(getMember, this, fieldName) !is null;
402 } else static if (is(typeof(mixin("this.isSetFlags." ~ fieldName)) : bool)) {
405 // This is a required field, which is always set.
410 static if (is(This _ == class)) {
481 static if (is(This _ == class)) {
555 * Nullable fields are just set to null to signal »not set«, so no flag is
565 code ~= "static if (!is(MemberType!(T, `" ~ meta.name ~ "`))) {\n"; in TIsSetFlags()
586 * be specified. If the pointerStruct parameter is set to true, the struct
587 * fields are expected to be pointers to the actual data. This is used
591 * This is a free function to make it possible to read exisiting structs from
600 // Check that all fields for which there is meta info are actually in the
603 code ~= "static assert(is(MemberType!(T, `" ~ field.name ~ "`)));\n";
607 // assigning it to v. The level parameter is used to make sure that there
610 // Some non-ambigous names to use (shadowing is not allowed in D).
621 static if (is(F == bool)) {
623 } else static if (is(F == byte)) {
625 } else static if (is(F == double)) {
627 } else static if (is(F == short)) {
629 } else static if (is(F == int)) {
631 } else static if (is(F == long)) {
633 } else static if (is(F : string)) {
635 } else static if (is(F == enum)) {
637 } else static if (is(F _ : E[], E)) {
647 } else static if (is(F _ : V[K], K, V)) {
661 } else static if (is(F _ : HashSet!(E), E)) {
673 } else static if (is(F == struct) || is(F : TException)) {
674 static if (is(F == struct)) {
779 * be specified. If the pointerStruct parameter is set to true, the struct
780 * fields are expected to be pointers to the actual data. This is used
784 * This is a free function to make it possible to read exisiting structs from
791 // Check that all fields for which there is meta info are actually in the
795 code ~= "static assert(is(MemberType!(T, `" ~ field.name ~ "`)));\n";
800 // into the writeStruct function body this is inside the string mixin
801 // block – the code wouldn't depend on it (this is an LDC bug, and because
808 code ~= "enforce(__traits(getMember, s, `" ~ name ~ "`) !is null,
809 new TException(`Required field '" ~ name ~ "' is null.`));\n";
819 // Some non-ambigous names to use (shadowing is not allowed in D).
825 static if (is(F == bool)) {
827 } else static if (is(F == byte)) {
829 } else static if (is(F == double)) {
831 } else static if (is(F == short)) {
833 } else static if (is(F == int)) {
835 } else static if (is(F == long)) {
837 } else static if (is(F : string)) {
839 } else static if (is(F == enum)) {
841 } else static if (is(F _ : E[], E)) {
848 } else static if (is(F _ : V[K], K, V)) {
856 } else static if (is(F _ : HashSet!E, E)) {
863 } else static if (is(F == struct) || is(F : TException)) {
991 static if (is(FullyUnqual!T == bool)) { in dToTTypeString()
993 } else static if (is(FullyUnqual!T == byte)) { in dToTTypeString()
995 } else static if (is(FullyUnqual!T == double)) { in dToTTypeString()
997 } else static if (is(FullyUnqual!T == short)) { in dToTTypeString()
999 } else static if (is(FullyUnqual!T == int)) { in dToTTypeString()
1001 } else static if (is(FullyUnqual!T == long)) { in dToTTypeString()
1003 } else static if (is(FullyUnqual!T : string)) { in dToTTypeString()
1005 } else static if (is(FullyUnqual!T == enum)) { in dToTTypeString()
1007 } else static if (is(FullyUnqual!T _ : U[], U)) { in dToTTypeString()
1009 } else static if (is(FullyUnqual!T _ : V[K], K, V)) { in dToTTypeString()
1011 } else static if (is(FullyUnqual!T _ : HashSet!E, E)) { in dToTTypeString()
1013 } else static if (is(FullyUnqual!T == struct)) { in dToTTypeString()
1015 } else static if (is(FullyUnqual!T : TException)) { in dToTTypeString()