本文整理匯總了C++中ACELIB_ERROR函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACELIB_ERROR函數的具體用法?C++ ACELIB_ERROR怎麽用?C++ ACELIB_ERROR使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACELIB_ERROR函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: base_type
ACE_Strategy_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Strategy_Connector
(ACE_Reactor *reactor,
ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> *conn_s,
ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
int flags)
: base_type (reactor),
creation_strategy_ (0),
delete_creation_strategy_ (false),
connect_strategy_ (0),
delete_connect_strategy_ (false),
concurrency_strategy_ (0),
delete_concurrency_strategy_ (false)
{
ACE_TRACE ("ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Strategy_Connector");
if (this->open (reactor, cre_s, conn_s, con_s, flags) == -1)
ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Strategy_Connector::ACE_Strategy_Connector")));
}
示例2: completion_port_
ACE_WIN32_Proactor::ACE_WIN32_Proactor (size_t number_of_threads,
bool used_with_reactor_event_loop)
: completion_port_ (0),
// This *MUST* be 0, *NOT* ACE_INVALID_HANDLE !!!
number_of_threads_ (static_cast<DWORD> (number_of_threads)),
used_with_reactor_event_loop_ (used_with_reactor_event_loop)
{
// Create the completion port.
this->completion_port_ = ::CreateIoCompletionPort (INVALID_HANDLE_VALUE,
0,
0,
this->number_of_threads_);
if (this->completion_port_ == 0)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("CreateIoCompletionPort")));
this->get_asynch_pseudo_task ().start ();
}
示例3: open_mode_
ACE_DLL::ACE_DLL (const ACE_DLL &rhs)
: open_mode_ (0),
dll_name_ (0),
close_handle_on_destruction_ (false),
dll_handle_ (0),
error_ (0)
{
ACE_TRACE ("ACE_DLL::ACE_DLL (const ACE_DLL &)");
if (rhs.dll_name_
// This will automatically up the refcount.
&& this->open (rhs.dll_name_,
rhs.open_mode_,
rhs.close_handle_on_destruction_) != 0
&& ACE::debug ())
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL::copy_ctor: error: %s\n"),
this->error ()));
}
示例4: ACE_TEXT
void
Linux_Network_Interface_Monitor::init (void)
{
for (unsigned long i = 0UL; i < MAX_INTERFACES; ++i)
{
this->value_array_[i] = 0UL;
}
/// Read the file once to get a base value that we can subtract
/// from subsequent readings to get bytes sent since we started
/// monitoring.
char buf[1024];
FILE* fp = ACE_OS::fopen (ACE_TEXT ("/proc/net/dev"),
ACE_TEXT ("r"));
if (fp == 0)
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("bytes sent - opening ")
ACE_TEXT ("/proc/net/dev failed\n")));
return;
}
/// Ignore the first 2 lines of the file, which are file
/// and column headers.
void* dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
ACE_UNUSED_ARG (dummy);
dummy = ACE_OS::fgets (buf, sizeof (buf), fp);
ACE_UNUSED_ARG (dummy);
unsigned long iface_value = 0UL;
ACE_UINT32 iface_index = 0UL;
while (ACE_OS::fgets (buf, sizeof (buf), fp) != 0)
{
sscanf (buf, this->scan_format_.c_str (), &iface_value);
this->start_ += iface_value;
++iface_index;
}
(void) ACE_OS::fclose (fp);
}
示例5: ssl_
ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream (ACE_SSL_Context *context)
: ssl_ (0),
stream_ ()
{
ACE_TRACE ("ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream");
ACE_SSL_Context * ctx =
(context == 0 ? ACE_SSL_Context::instance () : context);
this->ssl_ = ::SSL_new (ctx->context ());
if (this->ssl_ == 0)
{
ACELIB_ERROR ((LM_ERROR,
"(%P|%t) ACE_SSL_SOCK_Stream "
"- cannot allocate new SSL structure %p\n",
ACE_TEXT ("")));
}
}
示例6: ACE_Event_Handler
ACE_Process_Manager::ACE_Process_Manager (size_t size,
ACE_Reactor *r)
: ACE_Event_Handler (),
process_table_ (0),
max_process_table_size_ (0),
current_count_ (0),
default_exit_handler_ (0)
#if defined (ACE_HAS_THREADS)
, lock_ ()
#endif /* ACE_HAS_THREADS */
{
ACE_TRACE ("ACE_Process_Manager::ACE_Process_Manager");
if (this->open (size, r) == -1)
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Process_Manager")));
}
}
示例7: ACELIB_ERROR
ACE_SOCK::ACE_SOCK (int type,
int protocol_family,
int protocol,
ACE_Protocol_Info *protocolinfo,
ACE_SOCK_GROUP g,
u_long flags,
int reuse_addr)
{
// ACE_TRACE ("ACE_SOCK::ACE_SOCK");
if (this->open (type,
protocol_family,
protocol,
protocolinfo,
g,
flags,
reuse_addr) == -1)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_SOCK::ACE_SOCK")));
}
示例8: ACE_Event_Base
ACE_Event_T<TIME_POLICY>::ACE_Event_T (int manual_reset,
int initial_state,
int type,
const ACE_TCHAR *name,
void *arg,
LPSECURITY_ATTRIBUTES sa)
: ACE_Event_Base ()
{
ACE_Condition_Attributes_T<TIME_POLICY> cond_attr (type);
if (ACE_OS::event_init (&this->handle_,
type,
&const_cast<ACE_condattr_t&> (cond_attr.attributes ()),
manual_reset,
initial_state,
name,
arg,
sa) != 0)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Event_T<TIME_POLICY>::ACE_Event_T")));
}
示例9: ACE_TRACE
void
ACE_Token_Proxy_Queue::dequeue (void)
{
ACE_TRACE ("ACE_Token_Proxy_Queue::dequeue");
if (head_ == 0)
return;
ACE_TPQ_Entry *temp = this->head_;
this->head_ = this->head_->next_;
temp->next_ = 0;
--this->size_;
if (this->head_ == 0 && this->size_ != 0)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("incorrect size = %d\n"),
this->size_));
}
示例10: shmem_
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_System_Time::ACE_System_Time (const ACE_TCHAR *poolname)
: shmem_ (0)
, delta_time_ (0)
{
ACE_TRACE ("ACE_System_Time::ACE_System_Time");
// Only create a new unique filename for the memory pool file
// if the user didn't supply one...
if (poolname == 0)
{
#if defined (ACE_DEFAULT_BACKING_STORE)
// Create a temporary file.
ACE_OS::strcpy (this->poolname_,
ACE_DEFAULT_BACKING_STORE);
#else /* ACE_DEFAULT_BACKING_STORE */
if (ACE::get_temp_dir (this->poolname_,
MAXPATHLEN - 17) == -1)
// -17 for ace-malloc-XXXXXX
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("Temporary path too long, ")
ACE_TEXT ("defaulting to current directory\n")));
this->poolname_[0] = 0;
}
// Add the filename to the end
ACE_OS::strcat (this->poolname_, ACE_TEXT ("ace-malloc-XXXXXX"));
#endif /* ACE_DEFAULT_BACKING_STORE */
}
else
ACE_OS::strsncpy (this->poolname_,
poolname,
(sizeof this->poolname_ / sizeof (ACE_TCHAR)));
ACE_NEW (this->shmem_,
ALLOCATOR (this->poolname_));
}
示例11: switch
ACE_Service_Type_Impl *
ACE_Service_Config::create_service_type_impl (const ACE_TCHAR *name,
int type,
void *symbol,
u_int flags,
ACE_Service_Object_Exterminator gobbler)
{
ACE_Service_Type_Impl *stp = 0;
// Note, the only place we need to put a case statement. This is
// also the place where we'd put the RTTI tests, if the compiler
// actually supported them!
switch (type)
{
case ACE_Service_Type::SERVICE_OBJECT:
ACE_NEW_RETURN (stp,
ACE_Service_Object_Type ((ACE_Service_Object *) symbol,
name, flags,
gobbler),
0);
break;
case ACE_Service_Type::MODULE:
ACE_NEW_RETURN (stp,
ACE_Module_Type (symbol, name, flags),
0);
break;
case ACE_Service_Type::STREAM:
ACE_NEW_RETURN (stp,
ACE_Stream_Type (symbol, name, flags),
0);
break;
default:
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("unknown case\n")));
break;
}
return stp;
}
示例12: ACE_TEXT
void
CPU_Load_Monitor::access_proc_stat (unsigned long *which_idle)
{
this->file_ptr_ = ACE_OS::fopen (ACE_TEXT ("/proc/stat"),
ACE_TEXT ("r"));
if (this->file_ptr_ == 0)
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("CPU load - opening /proc/stat failed\n")));
return;
}
char *item = 0;
char *arg = 0;
while ((ACE_OS::fgets (buf_, sizeof (buf_), file_ptr_)) != 0)
{
item = ACE_OS::strtok (this->buf_, " \t\n");
arg = ACE_OS::strtok (0, "\n");
if (item == 0 || arg == 0)
{
continue;
}
if (ACE_OS::strcmp (item, "cpu") == 0)
{
sscanf (arg,
"%lu %lu %lu %lu",
&this->user_,
&this->wait_,
&this->kernel_,
which_idle);
break;
}
}
ACE_OS::fclose (this->file_ptr_);
}
示例13: ACE_TRACE
// Trigger reconfiguration to re-read configuration files.
void
ACE_Service_Config::reconfigure (void)
{
ACE_TRACE ("ACE_Service_Config::reconfigure");
ACE_Service_Config::reconfig_occurred_ = 0;
if (ACE::debug ())
{
#if !defined (ACE_NLOGGING)
time_t t = ACE_OS::time (0);
#endif /* ! ACE_NLOGGING */
if (ACE::debug ())
ACELIB_DEBUG ((LM_DEBUG,
ACE_TEXT ("beginning reconfiguration at %s"),
ACE_OS::ctime (&t)));
}
if (ACE_Service_Config::process_directives () == -1)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("process_directives")));
}
示例14: ACE_TRACE
ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap,
ACE_Protocol_Info *protocolinfo,
ACE_SOCK_GROUP g,
u_long flags,
int reuse_addr,
int protocol_family,
int backlog,
int protocol)
{
ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor");
if (this->open (local_sap,
protocolinfo,
g,
flags,
reuse_addr,
protocol_family,
backlog,
protocol) == -1)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_SOCK_Acceptor")));
}
示例15: ACELIB_ERROR
int
ACE_Proactor::close (void)
{
// Close the implementation.
if (this->implementation ()->close () == -1)
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%N:%l:(%P | %t):%p\n"),
ACE_TEXT ("ACE_Proactor::close: implementation close")));
// Delete the implementation.
if (this->delete_implementation_)
{
delete this->implementation ();
this->implementation_ = 0;
}
// Delete the timer handler.
if (this->timer_handler_)
{
delete this->timer_handler_;
this->timer_handler_ = 0;
}
// Delete the timer queue.
if (this->delete_timer_queue_)
{
delete this->timer_queue_;
this->timer_queue_ = 0;
this->delete_timer_queue_ = 0;
}
else if (this->timer_queue_)
{
this->timer_queue_->close ();
this->timer_queue_ = 0;
}
return 0;
}