本文整理汇总了C++中ACELIB_ERROR_RETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ ACELIB_ERROR_RETURN函数的具体用法?C++ ACELIB_ERROR_RETURN怎么用?C++ ACELIB_ERROR_RETURN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACELIB_ERROR_RETURN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ACE_TRACE
int
ACE_Token_Proxy::renew (int requeue_position,
ACE_Synch_Options &options)
{
ACE_TRACE ("ACE_Token_Proxy::renew");
if (this->token_ == 0)
{
errno = ENOENT;
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Not open.\n")),
-1);
}
// Make sure no one calls our token_acquired until we have a chance
// to sleep first!
this->waiter_->cond_var_.mutex ().acquire ();
if (this->token_->renew (this->waiter_, requeue_position) == -1)
{
// check for error
if (errno != EWOULDBLOCK)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p renew failed\n"), ACE_TEXT ("ACE_Token_Proxy")), -1);
if (this->debug_)
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) renew blocking for %s, owner is %s\n"),
this->name (),
token_->owner_id ()));
// no error, but would block, so block or return
return this->handle_options (options, waiter_->cond_var_);
}
else
// we have the token
{
if (this->debug_)
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) renewed %s\n"),
this->name ()));
waiter_->cond_var_.mutex ().release ();
return 0;
}
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:42,代码来源:Local_Tokens.cpp
示例2: ACELIB_ERROR_RETURN
void*
ACE_Threading_Helper<ACE_Thread_Mutex>::get (void)
{
void* temp = 0;
if (ACE_Thread::getspecific (key_, &temp) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) Service Config failed to get thread key value: %p\n"),
ACE_TEXT("")),
0);
return temp;
}
开发者ID:CCJY,项目名称:ACE,代码行数:11,代码来源:Service_Config.cpp
示例3: ACELIB_ERROR_RETURN
int
ACE_RAPI_Session::update_qos (void)
{
// Update the session QoS Parameters based on the RSVP Event Received.
if ((rsvp_error = rapi_dispatch ()) != 0)
ACELIB_ERROR_RETURN ((LM_ERROR,
"Error in rapi_dispatch () : %s\n",
rapi_errlist[rsvp_error]),
-1);
return 0;
}
开发者ID:AtVirus,项目名称:SkyFireEMU,代码行数:11,代码来源:QoS_Session_Impl.cpp
示例4: while
int
ACE_Proactor_Timer_Handler::svc (void)
{
ACE_Time_Value absolute_time;
ACE_Time_Value relative_time;
int result = 0;
while (this->shutting_down_ == 0)
{
// Check whether the timer queue has any items in it.
if (this->proactor_.timer_queue ()->is_empty () == 0)
{
// Get the earliest absolute time.
absolute_time = this->proactor_.timer_queue ()->earliest_time ();
// Get current time from timer queue since we don't know
// which <gettimeofday> was used.
ACE_Time_Value cur_time =
this->proactor_.timer_queue ()->gettimeofday ();
// Compare absolute time with curent time received from the
// timer queue.
if (absolute_time > cur_time)
relative_time = absolute_time - cur_time;
else
relative_time = ACE_Time_Value::zero;
// Block for relative time.
result = this->timer_event_.wait (&relative_time, 0);
}
else
// The timer queue has no entries, so wait indefinitely.
result = this->timer_event_.wait ();
// Check for timer expiries.
if (result == -1)
{
switch (errno)
{
case ETIME:
// timeout: expire timers
this->proactor_.timer_queue ()->expire ();
break;
default:
// Error.
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%N:%l:(%P | %t):%p\n"),
ACE_TEXT ("ACE_Proactor_Timer_Handler::svc:wait failed")),
-1);
}
}
}
return 0;
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:54,代码来源:Proactor.cpp
示例5: ACE_TRACE
int
ACE_Service_Config::parse_args_i (int argc, ACE_TCHAR *argv[])
{
ACE_TRACE ("ACE_Service_Config::parse_args_i");
// Using PERMUTE_ARGS (default) in order to have all
// unrecognized options and their value arguments moved
// to the end of the argument vector. We'll pick them up
// after processing our options and pass them on to the
// base class for further parsing.
//FUZZ: disable check_for_lack_ACE_OS
ACE_Get_Opt getopt (argc,
argv,
ACE_TEXT ("bs:p:"),
1 , // Start at argv[1].
0, // Do not report errors
ACE_Get_Opt::RETURN_IN_ORDER);
//FUZZ: enable check_for_lack_ACE_OS
//FUZZ: disable check_for_lack_ACE_OS
for (int c; (c = getopt ()) != -1; )
//FUZZ: enable check_for_lack_ACE_OS
switch (c)
{
case 'p':
ACE_Service_Config::pid_file_name_ = getopt.opt_arg ();
break;
case 'b':
ACE_Service_Config::be_a_daemon_ = true;
break;
case 's':
{
// There's no point in dealing with this on NT since it
// doesn't really support signals very well...
#if !defined (ACE_LACKS_UNIX_SIGNALS)
ACE_Service_Config::signum_ =
ACE_OS::atoi (getopt.opt_arg ());
if (ACE_Reactor::instance ()->register_handler
(ACE_Service_Config::signum_,
ACE_Service_Config::signal_handler_) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("cannot obtain signal handler\n")),
-1);
#endif /* ACE_LACKS_UNIX_SIGNALS */
break;
}
default:; // unknown arguments are benign
}
return 0;
} /* parse_args_i () */
开发者ID:CCJY,项目名称:ACE,代码行数:53,代码来源:Service_Config.cpp
示例6: ACE_TRACE
int
ACE_Remote_Token_Proxy::initiate_connection (void)
{
ACE_TRACE ("ACE_Remote_Token_Proxy::initiate_connection");
if (token_ == 0)
{
errno = ENOENT;
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("ACE_Remote_Token_Proxy not open.\n")), -1);
}
ACE_SOCK_Stream *peer = ACE_Token_Connections::instance ()->get_connection ();
return peer == 0 ? 0 : 1;
}
开发者ID:binary42,项目名称:OCI,代码行数:14,代码来源:Remote_Tokens.cpp
示例7: ACELIB_ERROR_RETURN
int
ACE_Proactor_Handle_Timeout_Upcall::proactor (ACE_Proactor &proactor)
{
if (this->proactor_ == 0)
{
this->proactor_ = &proactor;
return 0;
}
else
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("ACE_Proactor_Handle_Timeout_Upcall is only suppose")
ACE_TEXT (" to be used with ONE (and only one) Proactor\n")),
-1);
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:14,代码来源:Proactor.cpp
示例8: rapi_release
// Close the RAPI QoS Session.
int
ACE_RAPI_Session::close (void)
{
this->rsvp_error = rapi_release(this->session_id_);
if (rsvp_error == 0)
ACELIB_ERROR_RETURN ((LM_ERROR,
"Can't release RSVP session:\n\t%s\n",
rapi_errlist[rsvp_error]),
-1);
else
ACELIB_DEBUG ((LM_DEBUG,
"rapi session with id %d released successfully.\n",
this->session_id_));
return 0;
}
开发者ID:AtVirus,项目名称:SkyFireEMU,代码行数:17,代码来源:QoS_Session_Impl.cpp
示例9: ACE_TRACE
int
ACE_Name_Proxy::request_reply (ACE_Name_Request &request)
{
ACE_TRACE ("ACE_Name_Proxy::request_reply");
void *buffer;
ssize_t length = request.encode (buffer);
if (length == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("encode failed")),
-1);
// Transmit request via a blocking send.
if (this->peer_.send_n (buffer, length) != length)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("send_n failed")),
-1);
else
{
ACE_Name_Reply reply;
// Receive reply via blocking read.
if (this->peer_.recv_n (&reply,
sizeof reply) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("recv failed")),
-1);
else if (reply.decode () == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("decode failed")),
-1);
errno = int (reply.errnum ());
return reply.status ();
}
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:41,代码来源:Name_Proxy.cpp
示例10: ACE_TRACE
// Compute the new map_size of the backing store and commit the
// memory.
int
ACE_MMAP_Memory_Pool::commit_backing_store_name (size_t rounded_bytes,
size_t & map_size)
{
ACE_TRACE ("ACE_MMAP_Memory_Pool::commit_backing_store_name");
#if defined (__Lynx__)
map_size = rounded_bytes;
#else
size_t seek_len;
if (this->write_each_page_)
// Write to the end of every block to ensure that we have enough
// space in the backing store.
seek_len = this->round_up (1); // round_up(1) is one page.
else
// We're willing to risk it all in the name of efficiency...
seek_len = rounded_bytes;
// The following loop will execute multiple times (if
// this->write_each_page == 1) or just once (if
// this->write_each_page == 0).
for (size_t cur_block = 0;
cur_block < rounded_bytes;
cur_block += seek_len)
{
map_size =
ACE_Utils::truncate_cast<size_t> (
ACE_OS::lseek (this->mmap_.handle (),
static_cast<ACE_OFF_T> (seek_len - 1),
SEEK_END));
if (map_size == static_cast<size_t> (-1)
|| ACE_OS::write (this->mmap_.handle (),
"",
1) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) %p\n"),
this->backing_store_name_),
-1);
}
#if defined (ACE_OPENVMS)
::fsync(this->mmap_.handle());
#endif
// Increment by one to put us at the beginning of the next chunk...
++map_size;
#endif /* __Lynx__ */
return 0;
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:54,代码来源:MMAP_Memory_Pool.cpp
示例11: ACELIB_ERROR_RETURN
int
ACE_ARGV_T<CHAR_TYPE>::add (const CHAR_TYPE *next_arg, bool quote_arg)
{
// Only allow this to work in the "iterative" verion -- the
// ACE_ARGVs created with the one argument constructor.
if (!this->iterative_)
{
errno = EINVAL;
return -1;
}
this->length_ += ACE_OS::strlen (next_arg);
if (quote_arg && ACE_OS::strchr (next_arg, ' ') != 0)
{
this->length_ += 2;
if (ACE_OS::strchr (next_arg, '"') != 0)
for (const CHAR_TYPE * p = next_arg; *p != '\0'; ++p)
if (*p == '"') ++this->length_;
}
else
{
quote_arg = false;
}
// Put the new argument at the end of the queue.
if (this->queue_.enqueue_tail (ACE_ARGV_Queue_Entry_T<CHAR_TYPE> (next_arg, quote_arg)) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Can't add more to ARGV queue")),
-1);
++this->argc_;
// Wipe argv_ and buf_ away so that they will be recreated if the
// user calls argv () or buf ().
if (this->argv_ != 0)
{
for (int i = 0; this->argv_[i] != 0; i++)
ACE_OS::free ((void *) this->argv_[i]);
delete [] this->argv_;
this->argv_ = 0;
}
delete [] this->buf_;
this->buf_ = 0;
return 0;
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:48,代码来源:ARGV.cpp
示例12: ACELIB_ERROR_RETURN
size_t
Monitor_Base::count (void) const
{
if (this->data_.type_ == Monitor_Control_Types::MC_GROUP)
{
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("count: %s is a monitor group\n"),
this->name_.c_str ()),
0UL);
}
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->mutex_, 0UL);
return (this->data_.type_ == Monitor_Control_Types::MC_COUNTER
? static_cast<size_t> (this->data_.last_)
: this->data_.index_);
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:17,代码来源:Monitor_Base.cpp
示例13: ACELIB_ERROR_RETURN
template <class HANDLER> int
ACE_Asynch_Connector<HANDLER>::connect (const ACE_INET_Addr & remote_sap,
const ACE_INET_Addr & local_sap,
int reuse_addr,
const void *act)
{
// Initiate asynchronous connect
if (this->asynch_connect_.connect (ACE_INVALID_HANDLE,
remote_sap,
local_sap,
reuse_addr,
act) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Asynch_Connect::connect")),
-1);
return 0;
}
开发者ID:Adeer,项目名称:OregonCore,代码行数:18,代码来源:Asynch_Connector.cpp
示例14: ACE_TRACE
void *
ACE_Sbrk_Memory_Pool::acquire (size_t nbytes,
size_t &rounded_bytes)
{
ACE_TRACE ("ACE_Sbrk_Memory_Pool::acquire");
rounded_bytes = this->round_up (nbytes);
// ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) acquiring more chunks, nbytes = %d, rounded_bytes = %d\n"), nbytes, rounded_bytes));
void *cp = ACE_OS::sbrk (rounded_bytes);
if (cp == MAP_FAILED)
ACELIB_ERROR_RETURN ((LM_ERROR,
"(%P|%t) cp = %u\n",
cp),
0);
else
// ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) acquired more chunks, nbytes = %d, rounded_bytes = %d, new break = %u\n"), nbytes, rounded_bytes, cp));
return cp;
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:18,代码来源:Sbrk_Memory_Pool.cpp
示例15: ACE_NEW_RETURN
rapi_flowspec_t *
ACE_RAPI_Session::init_flowspec_simplified(const ACE_Flow_Spec &flow_spec)
{
rapi_flowspec_t *flowsp;
ACE_NEW_RETURN (flowsp,
rapi_flowspec_t,
0);
// Extended Legacy format.
qos_flowspecx_t *csxp = &flowsp->specbody_qosx;
// Choose based on the service type : [QOS_GUARANTEEDX/QOS_CNTR_LOAD].
switch (flow_spec.service_type ())
{
case QOS_GUARANTEEDX:
csxp->xspec_R = 0 ; // Guaranteed Rate B/s. @@How does this map to the
// ACE Flow Spec Parameters.
csxp->xspec_S = flow_spec.delay_variation () ; // Slack term in MICROSECONDS
// Note there is no break !!
case QOS_CNTR_LOAD:
csxp->spec_type = flow_spec.service_type (); // qos_service_type
csxp->xspec_r = flow_spec.token_rate (); // Token Bucket Average Rate (B/s)
csxp->xspec_b = flow_spec.token_bucket_size (); // Token Bucket Rate (B)
csxp->xspec_p = flow_spec.peak_bandwidth (); // Peak Data Rate (B/s)
csxp->xspec_m = flow_spec.minimum_policed_size (); // Minimum Policed Unit (B)
csxp->xspec_M = flow_spec.max_sdu_size(); // Max Packet Size (B)
flowsp->form = RAPI_FLOWSTYPE_Simplified;
break;
default:
ACELIB_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Unknown flowspec type: %u\n",flow_spec.service_type () ),
0);
}
flowsp->len = sizeof(rapi_flowspec_t);
return flowsp;
}
开发者ID:AtVirus,项目名称:SkyFireEMU,代码行数:44,代码来源:QoS_Session_Impl.cpp
示例16: ACE_UNUSED_ARG
int
ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set,
const ACE_NS_WString &pattern)
{
ACE_UNUSED_ARG(pattern);
ACE_Registry::Binding_List list;
int result = this->context_.list (list);
if (result != 0)
return result;
// Iterator through all entries
for (ACE_Registry::Binding_List::iterator i = list.begin ();
i != list.end ();
i++)
{
// Yeeesss! STL rules!
ACE_Registry::Binding &binding = *i;
if (binding.type () == ACE_Registry::OBJECT)
{
// Key
ACE_TString string = binding.name ();
ACE_NS_WString key (string.c_str ());
// Value
ACE_NS_WString value;
char *type = 0;
result = this->resolve (key,
value,
type);
if (result != 0)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Registry::Naming_Context::resolve")),
result);
// Complete binding
ACE_Name_Binding binding (key, value, type);
set.insert (binding);
}
}
return 0;
}
开发者ID:CCJY,项目名称:ACE,代码行数:44,代码来源:Registry_Name_Space.cpp
示例17: ACE_TRACE
int
ACE_Token_Collection::insert (ACE_Token_Proxy &new_token)
{
ACE_TRACE ("ACE_Token_Collection::insert");
TOKEN_NAME name (new_token.name ());
// Check if the new_proxy is already in the list.
if (collection_.find (name) == 1)
// One already exists, so fail.
return -1;
// Clone the new token.
ACE_Token_Proxy *temp = new_token.clone ();
if (collection_.bind (name, temp) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("bind failed\n")), -1);
return 0;
}
开发者ID:GlassFace,项目名称:sunwell,代码行数:19,代码来源:Token_Collection.cpp
示例18: ACE_UNUSED_ARG
int
ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr,
ACE_OFF_T &offset,
size_t &counter)
{
#ifndef ACE_HAS_SYSV_IPC
ACE_UNUSED_ARG (searchPtr);
ACE_UNUSED_ARG (offset);
ACE_UNUSED_ARG (counter);
ACE_NOTSUP_RETURN (-1);
#else
offset = 0;
SHM_TABLE *st = reinterpret_cast<SHM_TABLE *> (this->base_addr_);
shmid_ds buf;
for (counter = 0;
counter < this->max_segments_
&& st[counter].used_ == 1;
counter++)
{
if (ACE_OS::shmctl (st[counter].shmid_, IPC_STAT, &buf) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) %p\n"),
ACE_TEXT ("shmctl")),
-1);
offset += buf.shm_segsz;
// If segment 'counter' starts at a location greater than the
// place we are searching for. We then decrement the offset to
// the start of counter-1. ([email protected])
if (((ptrdiff_t) offset + (ptrdiff_t) (this->base_addr_)) > (ptrdiff_t) searchPtr)
{
--counter;
offset -= buf.shm_segsz;
return 0;
}
// ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset));
}
return 0;
#endif
}
开发者ID:binary42,项目名称:OCI,代码行数:42,代码来源:Shared_Memory_Pool.cpp
示例19: ACE_TRACE
void *
ACE_Local_Memory_Pool::acquire (size_t nbytes,
size_t &rounded_bytes)
{
ACE_TRACE ("ACE_Local_Memory_Pool::acquire");
rounded_bytes = this->round_up (nbytes);
char *temp = 0;
ACE_NEW_RETURN (temp,
char[rounded_bytes],
0);
ACE_Auto_Basic_Array_Ptr<char> cp (temp);
if (this->allocated_chunks_.insert (cp.get ()) != 0)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) insertion into set failed\n")),
0);
return cp.release ();
}
开发者ID:CCJY,项目名称:ACE,代码行数:21,代码来源:Local_Memory_Pool.cpp
示例20: ACE_TRACE
int
ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set,
const ACE_NS_WString &pattern)
{
ACE_TRACE ("ACE_Remote_Name_Space::list_type_entries");
ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> pattern_urep (pattern.rep ());
ACE_UINT32 pattern_len =
static_cast<ACE_UINT32> (pattern.length () * sizeof (ACE_WCHAR_T));
ACE_Name_Request request (ACE_Name_Request::LIST_TYPE_ENTRIES,
pattern_urep.get (),
pattern_len,
0, 0, 0, 0);
if (this->ns_proxy_.send_request (request) == -1)
return -1;
ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0);
while (reply.msg_type () != ACE_Name_Request::MAX_ENUM)
{
if (this->ns_proxy_.recv_reply (reply) == -1)
ACELIB_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Remote_Name_Space::list_values")),
-1);
if (reply.msg_type () != ACE_Name_Request::MAX_ENUM)
{
ACE_NS_WString name (reply.name (),
reply.name_len () / sizeof (ACE_WCHAR_T));
ACE_NS_WString value (reply.value (),
reply.value_len () / sizeof (ACE_WCHAR_T));
ACE_Name_Binding entry (name,
value,
reply.type ());
if (set.insert (entry) == -1)
return -1;
}
}
return 0;
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:40,代码来源:Remote_Name_Space.cpp
注:本文中的ACELIB_ERROR_RETURN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论