DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// (C) Copyright Gennadiy Rozental 2001-2007. // 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 41369 $ // // Description : simple facility that mimmic notion of read-only read-write // properties in C++ classes. Original idea by Henrik Ravn. // *************************************************************************** #ifndef BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER #define BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER // Boost.Test #include
// Boost #if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) #include
#endif #include
#include
#include
#include
// STL #include
#include
//____________________________________________________________________________// namespace boost { namespace unit_test { // ************************************************************************** // // ************** class_property ************** // // ************************************************************************** // template
class class_property { protected: typedef typename call_traits
::const_reference read_access_t; typedef typename call_traits
::param_type write_param_t; #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) typedef typename add_pointer
::type address_res_t; #else typedef typename add_pointer
::type>::type address_res_t; #endif public: // Constructor class_property() : value( PropertyType() ) {} explicit class_property( write_param_t init_value ) : value( init_value ) {} // Access methods operator read_access_t() const { return value; } read_access_t get() const { return value; } bool operator!() const { return !value; } address_res_t operator&() const { return &value; } // Data members #ifndef BOOST_TEST_NO_PROTECTED_USING protected: #endif PropertyType value; }; //____________________________________________________________________________// #ifdef BOOST_CLASSIC_IOSTREAMS template
inline std::ostream& operator<<( std::ostream& os, class_property
const& p ) #else template
inline std::basic_ostream
& operator<<( std::basic_ostream
& os, class_property
const& p ) #endif { return os << p.get(); } //____________________________________________________________________________// #define DEFINE_PROPERTY_FREE_BINARY_OPERATOR( op ) \ template
\ inline bool \ operator op( PropertyType const& lhs, class_property
const& rhs ) \ { \ return lhs op rhs.get(); \ } \ template
\ inline bool \ operator op( class_property
const& lhs, PropertyType const& rhs ) \ { \ return lhs.get() op rhs; \ } \ template
\ inline bool \ operator op( class_property
const& lhs, \ class_property
const& rhs ) \ { \ return lhs.get() op rhs.get(); \ } \ /**/ DEFINE_PROPERTY_FREE_BINARY_OPERATOR( == ) DEFINE_PROPERTY_FREE_BINARY_OPERATOR( != ) #undef DEFINE_PROPERTY_FREE_BINARY_OPERATOR #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) #define DEFINE_PROPERTY_LOGICAL_OPERATOR( op ) \ template
\ inline bool \ operator op( bool b, class_property
const& p ) \ { \ return b op p.get(); \ } \ template
\ inline bool \ operator op( class_property
const& p, bool b ) \ { \ return b op p.get(); \ } \ /**/ DEFINE_PROPERTY_LOGICAL_OPERATOR( && ) DEFINE_PROPERTY_LOGICAL_OPERATOR( || ) #endif // ************************************************************************** // // ************** readonly_property ************** // // ************************************************************************** // template
class readonly_property : public class_property
{ typedef class_property
base_prop; typedef typename base_prop::address_res_t arrow_res_t; protected: typedef typename base_prop::write_param_t write_param_t; public: // Constructor readonly_property() {} explicit readonly_property( write_param_t init_value ) : base_prop( init_value ) {} // access methods arrow_res_t operator->() const { return boost::addressof( base_prop::value ); } }; //____________________________________________________________________________// #if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) #define BOOST_READONLY_PROPERTY( property_type, friends ) boost::unit_test::readwrite_property
#else #define BOOST_READONLY_PROPERTY_DECLARE_FRIEND(r, data, elem) friend class elem; #define BOOST_READONLY_PROPERTY( property_type, friends ) \ class BOOST_JOIN( readonly_property, __LINE__ ) \ : public boost::unit_test::readonly_property
{ \ typedef boost::unit_test::readonly_property
base_prop; \ BOOST_PP_SEQ_FOR_EACH( BOOST_READONLY_PROPERTY_DECLARE_FRIEND, ' ', friends ) \ typedef base_prop::write_param_t write_param_t; \ public: \ BOOST_JOIN( readonly_property, __LINE__ )() {} \ explicit BOOST_JOIN( readonly_property, __LINE__ )( write_param_t init_v ) \ : base_prop( init_v ) {} \ } \ /**/ #endif // ************************************************************************** // // ************** readwrite_property ************** // // ************************************************************************** // template
class readwrite_property : public class_property
{ typedef class_property
base_prop; typedef typename add_pointer
::type arrow_res_t; typedef typename base_prop::address_res_t const_arrow_res_t; typedef typename base_prop::write_param_t write_param_t; public: readwrite_property() : base_prop() {} explicit readwrite_property( write_param_t init_value ) : base_prop( init_value ) {} // access methods void set( write_param_t v ) { base_prop::value = v; } arrow_res_t operator->() { return boost::addressof( base_prop::value ); } const_arrow_res_t operator->() const { return boost::addressof( base_prop::value ); } #ifndef BOOST_TEST_NO_PROTECTED_USING using base_prop::value; #endif }; //____________________________________________________________________________// } // unit_test } // namespace boost //____________________________________________________________________________// #include
#undef BOOST_TEST_NO_PROTECTED_USING #endif // BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
class_properties.hpp
Page URL
File URL
Prev
4/13
Next
Download
( 9 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.