/*************************************************************************** * * Copyright (c) 2008 Baidu.com, Inc. All Rights Reserved * $Id: IBinaryDeserializer.h,v 1.3 2009/06/15 06:29:05 chenxm Exp $ * **************************************************************************/ /** * @file IBinaryDeserializer.h * @author duchuanying(duchuanying@baidu.com) * @date 2008/11/01 21:37:08 * @version $Revision: 1.3 $ * @brief mcpack -> IVar * **/ #ifndef __BSL_VAR_IBINARY_DESERIALIZER_H__ #define __BSL_VAR_IBINARY_DESERIALIZER_H__ #include #include #include namespace bsl{ namespace var{ class IBinaryDeserializer{ public: virtual ~IBinaryDeserializer(){} /** * @brief 反序列化buffer为Var对象 * * 默认实现,如无特殊需要,子类不必重写该函数。 * * @param [in] buf : const void* * @param [in] max_size : size_t * @return IVar& * @retval * @see * @author chenxm * @date 2010/12/02 16:58:09 **/ virtual IVar& deserialize(const void* buf, size_t max_size){ size_t res = try_deserialize( buf, max_size ); if ( res > max_size ){ throw bsl::OutOfBoundException()<="<