x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
basic_binary_oprimitive.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\archive\basic_binary_oprimitive.hpp
Girar
Efecto
Propiedad
Historial
#ifndef BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP #define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // basic_binary_oprimitive.hpp // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. // archives stored as native binary - this should be the fastest way // to archive the state of a group of obects. It makes no attempt to // convert to any canonical form. // IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE // ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON #include
#include
#include
#include
// size_t #include
// basic_streambuf #include
#include
#if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif #include
//#include
//#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// must be the last header namespace boost { namespace archive { ///////////////////////////////////////////////////////////////////////// // class basic_binary_oprimitive - binary output of prmitives template
class basic_binary_oprimitive { #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS friend class save_access; protected: #else public: #endif std::basic_streambuf
& m_sb; // return a pointer to the most derived class Archive * This(){ return static_cast
(this); } boost::scoped_ptr
archive_locale; basic_streambuf_locale_saver
locale_saver; // default saving of primitives. template
void save(const T & t) { save_binary(& t, sizeof(T)); } ///////////////////////////////////////////////////////// // fundamental types that need special treatment // trap usage of invalid uninitialized boolean which would // otherwise crash on load. void save(const bool t){ int i = t; assert(0 == i || 1 == i); save_binary(& t, sizeof(t)); } BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) save(const std::wstring &ws); #endif BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) save(const char * t); BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) save(const wchar_t * t); BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) init(); BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_binary_oprimitive( std::basic_streambuf
& sb, bool no_codecvt ); BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) ~basic_binary_oprimitive(); public: // we provide an optimized save for all fundamental types // typedef serialization::is_bitwise_serializable
// use_array_optimization; // workaround without using mpl lambdas struct use_array_optimization { template
struct apply : public serialization::is_bitwise_serializable
{}; }; // the optimized save_array dispatches to save_binary template
void save_array(serialization::array
const& a, unsigned int) { save_binary(a.address(),a.count()*sizeof(ValueType)); } void save_binary(const void *address, std::size_t count); }; template
inline void basic_binary_oprimitive
::save_binary( const void *address, std::size_t count ){ //assert( // static_cast
((std::numeric_limits
::max)()) >= count //); // note: if the following assertions fail // a likely cause is that the output stream is set to "text" // mode where by cr characters recieve special treatment. // be sure that the output stream is opened with ios::binary //if(os.fail()) // boost::throw_exception(archive_exception(archive_exception::stream_error)); // figure number of elements to output - round up count = ( count + sizeof(Elem) - 1) / sizeof(Elem); std::streamsize scount = m_sb.sputn( static_cast
(address), count ); if(count != static_cast
(scount)) boost::throw_exception(archive_exception(archive_exception::stream_error)); //os.write( // static_cast
(address), // count //); //assert(os.good()); } } //namespace boost } //namespace archive #include
// pop pragams #endif // BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP
basic_binary_oprimitive.hpp
Dirección de la página
Dirección del archivo
Anterior
7/46
Siguiente
Descargar
( 5 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.