Remove indirection in LoadBalancedReply serialization
This commit is contained in:
parent
bd3cfb12eb
commit
0569df00f6
|
@ -119,7 +119,7 @@ struct GetValueReply : public LoadBalancedReply {
|
|||
|
||||
template <class Ar>
|
||||
void serialize( Ar& ar ) {
|
||||
serializer(ar, *(LoadBalancedReply*)this, value);
|
||||
serializer(ar, penalty, error, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -167,7 +167,7 @@ struct GetKeyValuesReply : public LoadBalancedReply {
|
|||
|
||||
template <class Ar>
|
||||
void serialize( Ar& ar ) {
|
||||
serializer(ar, *(LoadBalancedReply*)this, data, version, more, arena);
|
||||
serializer(ar, penalty, error, data, version, more, arena);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -198,7 +198,7 @@ struct GetKeyReply : public LoadBalancedReply {
|
|||
|
||||
template <class Ar>
|
||||
void serialize( Ar& ar ) {
|
||||
serializer(ar, *(LoadBalancedReply*)this, sel);
|
||||
serializer(ar, penalty, error, sel);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -66,15 +66,11 @@ struct ModelHolder : NonCopyable, public ReferenceCounted<ModelHolder> {
|
|||
};
|
||||
|
||||
// Subclasses must initialize all members in their default constructors
|
||||
// Subclasses must serialize all members
|
||||
struct LoadBalancedReply {
|
||||
double penalty;
|
||||
Optional<Error> error;
|
||||
LoadBalancedReply() : penalty(1.0) {}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar &ar) {
|
||||
serializer(ar, penalty, error);
|
||||
}
|
||||
};
|
||||
|
||||
Optional<LoadBalancedReply> getLoadBalancedReply(LoadBalancedReply *reply);
|
||||
|
|
Loading…
Reference in New Issue