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
indexed_properties.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\graph\detail\indexed_properties.hpp
Girar
Efecto
Propiedad
Historial
// Copyright 2005 The Trustees of Indiana University. // Distributed under 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) // Authors: Jeremiah Willcock // Douglas Gregor // Andrew Lumsdaine // Indexed properties -- used for CSR and CSR-like graphs #ifndef BOOST_GRAPH_INDEXED_PROPERTIES_HPP #define BOOST_GRAPH_INDEXED_PROPERTIES_HPP #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace detail { template
class indexed_vertex_properties { public: typedef no_property vertex_property_type; typedef Property vertex_bundled; // Directly access a vertex or edge bundle Property& operator[](Descriptor v) { return m_vertex_properties[get(vertex_index, derived(), v)]; } const Property& operator[](Descriptor v) const { return m_vertex_properties[get(vertex_index, derived(), v)]; } protected: // Default-construct with no property values indexed_vertex_properties() {} // Initialize with n default-constructed property values indexed_vertex_properties(std::size_t n) : m_vertex_properties(n) { } public: // Resize the properties vector void resize(std::size_t n) { m_vertex_properties.resize(n); } // Reserve space in the vector of properties void reserve(std::size_t n) { m_vertex_properties.reserve(n); } // Add a new property value to the back void push_back(const Property& prop) { m_vertex_properties.push_back(prop); } // Access to the derived object Derived& derived() { return *static_cast
(this); } const Derived& derived() const { return *static_cast
(this); } public: // should be private, but friend templates not portable std::vector
m_vertex_properties; }; template
class indexed_vertex_properties
{ struct secret {}; public: typedef no_property vertex_property_type; typedef void vertex_bundled; secret operator[](secret) { return secret(); } protected: // All operations do nothing. indexed_vertex_properties() { } indexed_vertex_properties(std::size_t) { } public: void resize(std::size_t) { } void reserve(std::size_t) { } }; template
class indexed_edge_properties { public: typedef no_property edge_property_type; typedef Property edge_bundled; typedef Property edge_push_back_type; // Directly access a edge or edge bundle Property& operator[](Descriptor v) { return m_edge_properties[get(edge_index, derived(), v)]; } const Property& operator[](Descriptor v) const { return m_edge_properties[get(edge_index, derived(), v)]; } protected: // Default-construct with no property values indexed_edge_properties() {} // Initialize with n default-constructed property values indexed_edge_properties(std::size_t n) : m_edge_properties(n) { } // Resize the properties vector void resize(std::size_t n) { m_edge_properties.resize(n); } // Reserve space in the vector of properties void reserve(std::size_t n) { m_edge_properties.reserve(n); } public: // Add a new property value to the back void push_back(const Property& prop) { m_edge_properties.push_back(prop); } private: // Access to the derived object Derived& derived() { return *static_cast
(this); } const Derived& derived() const { return *static_cast
(this); } public: // should be private, but friend templates not portable std::vector
m_edge_properties; }; template
class indexed_edge_properties
{ struct secret {}; public: typedef no_property edge_property_type; typedef void edge_bundled; typedef void* edge_push_back_type; secret operator[](secret) { return secret(); } protected: // All operations do nothing. indexed_edge_properties() { } indexed_edge_properties(std::size_t) { } void resize(std::size_t) { } void reserve(std::size_t) { } public: void push_back(const edge_push_back_type&) { } }; } } #endif // BOOST_GRAPH_INDEXED_PROPERTIES_HPP
indexed_properties.hpp
Dirección de la página
Dirección del archivo
Anterior
8/16
Siguiente
Descargar
( 4 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.