mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-29 16:45:19 +02:00
cleaned up namespaces
This commit is contained in:
parent
d721c6f1fd
commit
5a073db9fe
@ -8,128 +8,128 @@
|
|||||||
|
|
||||||
using namespace json_spirit;
|
using namespace json_spirit;
|
||||||
|
|
||||||
bool json_spirit::read( const std::string& s, Value& value )
|
bool json_spirit::read( const std::string& s, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
return read_string( s, value );
|
return read_string( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( const std::string& s, Value& value )
|
void json_spirit::read_or_throw( const std::string& s, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
read_string_or_throw( s, value );
|
read_string_or_throw( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::istream& is, Value& value )
|
bool json_spirit::read( std::istream& is, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
return read_stream( is, value );
|
return read_stream( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::istream& is, Value& value )
|
void json_spirit::read_or_throw( std::istream& is, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
read_stream_or_throw( is, value );
|
read_stream_or_throw( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
|
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
return read_range( begin, end, value );
|
return read_range( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
|
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::Value& value )
|
||||||
{
|
{
|
||||||
begin = read_range_or_throw( begin, end, value );
|
begin = read_range_or_throw( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef BOOST_NO_STD_WSTRING
|
#ifndef BOOST_NO_STD_WSTRING
|
||||||
|
|
||||||
bool json_spirit::read( const std::wstring& s, wValue& value )
|
bool json_spirit::read( const std::wstring& s, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
return read_string( s, value );
|
return read_string( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
|
void json_spirit::read_or_throw( const std::wstring& s, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
read_string_or_throw( s, value );
|
read_string_or_throw( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::wistream& is, wValue& value )
|
bool json_spirit::read( std::wistream& is, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
return read_stream( is, value );
|
return read_stream( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::wistream& is, wValue& value )
|
void json_spirit::read_or_throw( std::wistream& is, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
read_stream_or_throw( is, value );
|
read_stream_or_throw( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
|
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
return read_range( begin, end, value );
|
return read_range( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
|
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wValue& value )
|
||||||
{
|
{
|
||||||
begin = read_range_or_throw( begin, end, value );
|
begin = read_range_or_throw( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool json_spirit::read( const std::string& s, mValue& value )
|
bool json_spirit::read( const std::string& s, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
return read_string( s, value );
|
return read_string( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( const std::string& s, mValue& value )
|
void json_spirit::read_or_throw( const std::string& s, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
read_string_or_throw( s, value );
|
read_string_or_throw( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::istream& is, mValue& value )
|
bool json_spirit::read( std::istream& is, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
return read_stream( is, value );
|
return read_stream( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::istream& is, mValue& value )
|
void json_spirit::read_or_throw( std::istream& is, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
read_stream_or_throw( is, value );
|
read_stream_or_throw( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
|
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
return read_range( begin, end, value );
|
return read_range( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
|
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, json_spirit::mValue& value )
|
||||||
{
|
{
|
||||||
begin = read_range_or_throw( begin, end, value );
|
begin = read_range_or_throw( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef BOOST_NO_STD_WSTRING
|
#ifndef BOOST_NO_STD_WSTRING
|
||||||
|
|
||||||
bool json_spirit::read( const std::wstring& s, wmValue& value )
|
bool json_spirit::read( const std::wstring& s, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
return read_string( s, value );
|
return read_string( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
|
void json_spirit::read_or_throw( const std::wstring& s, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
read_string_or_throw( s, value );
|
read_string_or_throw( s, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::wistream& is, wmValue& value )
|
bool json_spirit::read( std::wistream& is, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
return read_stream( is, value );
|
return read_stream( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
|
void json_spirit::read_or_throw( std::wistream& is, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
read_stream_or_throw( is, value );
|
read_stream_or_throw( is, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
|
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
return read_range( begin, end, value );
|
return read_range( begin, end, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
|
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, json_spirit::wmValue& value )
|
||||||
{
|
{
|
||||||
begin = read_range_or_throw( begin, end, value );
|
begin = read_range_or_throw( begin, end, value );
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,6 @@
|
|||||||
#warning Compiling without BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME and BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME uncommented in boost/interprocess/detail/tmp_dir_helpers.hpp or using a boost version before 1.49 may have unintended results see svn.boost.org/trac/boost/ticket/5392
|
#warning Compiling without BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME and BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME uncommented in boost/interprocess/detail/tmp_dir_helpers.hpp or using a boost version before 1.49 may have unintended results see svn.boost.org/trac/boost/ticket/5392
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace boost;
|
|
||||||
using namespace boost::interprocess;
|
|
||||||
using namespace boost::posix_time;
|
|
||||||
|
|
||||||
#if defined MAC_OSX || defined __FreeBSD__
|
#if defined MAC_OSX || defined __FreeBSD__
|
||||||
// URI handling not implemented on OSX yet
|
// URI handling not implemented on OSX yet
|
||||||
|
|
||||||
@ -93,14 +89,14 @@ static void ipcThread2(void* pArg)
|
|||||||
{
|
{
|
||||||
printf("ipcThread started\n");
|
printf("ipcThread started\n");
|
||||||
|
|
||||||
message_queue* mq = (message_queue*)pArg;
|
boost::interprocess::message_queue* mq = (boost::interprocess::message_queue*)pArg;
|
||||||
char buffer[MAX_URI_LENGTH + 1] = "";
|
char buffer[MAX_URI_LENGTH + 1] = "";
|
||||||
size_t nSize = 0;
|
size_t nSize = 0;
|
||||||
unsigned int nPriority = 0;
|
unsigned int nPriority = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(100);
|
boost::posix_time::ptime d = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::millisec(100);
|
||||||
if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d))
|
if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d))
|
||||||
{
|
{
|
||||||
uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize));
|
uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize));
|
||||||
@ -112,25 +108,25 @@ static void ipcThread2(void* pArg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove message queue
|
// Remove message queue
|
||||||
message_queue::remove(curecoinURI_QUEUE_NAME);
|
boost::interprocess::message_queue::remove(curecoinURI_QUEUE_NAME);
|
||||||
// Cleanup allocated memory
|
// Cleanup allocated memory
|
||||||
delete mq;
|
delete mq;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ipcInit(int argc, char *argv[])
|
void ipcInit(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
message_queue* mq = NULL;
|
boost::interprocess::message_queue* mq = NULL;
|
||||||
char buffer[MAX_URI_LENGTH + 1] = "";
|
char buffer[MAX_URI_LENGTH + 1] = "";
|
||||||
size_t nSize = 0;
|
size_t nSize = 0;
|
||||||
unsigned int nPriority = 0;
|
unsigned int nPriority = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mq = new message_queue(open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH);
|
mq = new boost::interprocess::message_queue(boost::interprocess::open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH);
|
||||||
|
|
||||||
// Make sure we don't lose any curecoin: URIs
|
// Make sure we don't lose any curecoin: URIs
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(1);
|
boost::posix_time::ptime d = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::millisec(1);
|
||||||
if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d))
|
if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d))
|
||||||
{
|
{
|
||||||
uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize));
|
uiInterface.ThreadSafeHandleURI(std::string(buffer, nSize));
|
||||||
@ -140,12 +136,12 @@ void ipcInit(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure only one curecoin instance is listening
|
// Make sure only one curecoin instance is listening
|
||||||
message_queue::remove(curecoinURI_QUEUE_NAME);
|
boost::interprocess::message_queue::remove(curecoinURI_QUEUE_NAME);
|
||||||
delete mq;
|
delete mq;
|
||||||
|
|
||||||
mq = new message_queue(open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH);
|
mq = new boost::interprocess::message_queue(boost::interprocess::open_or_create, curecoinURI_QUEUE_NAME, 2, MAX_URI_LENGTH);
|
||||||
}
|
}
|
||||||
catch (interprocess_exception &ex) {
|
catch (boost::interprocess::interprocess_exception &ex) {
|
||||||
printf("ipcInit() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what());
|
printf("ipcInit() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user