这篇教程C++ ACE_SET_BITS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACE_SET_BITS函数的典型用法代码示例。如果您正苦于以下问题:C++ ACE_SET_BITS函数的具体用法?C++ ACE_SET_BITS怎么用?C++ ACE_SET_BITS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACE_SET_BITS函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ACE_TRACEtemplate <ACE_SYNCH_DECL> intACE_Module<ACE_SYNCH_USE>::open (const ACE_TCHAR *module_name, ACE_Task<ACE_SYNCH_USE> *writer_q, ACE_Task<ACE_SYNCH_USE> *reader_q, void *arg, int flags /* = M_DELETE */){ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::open"); this->name (module_name); this->arg_ = arg; // We may already have readers and/or writers. if (this->reader ()) this->close_i (0, M_DELETE_READER); if (this->writer ()) this->close_i (1, M_DELETE_WRITER); if (writer_q == 0) { ACE_NEW_RETURN (writer_q, ACE_Thru_Task<ACE_SYNCH_USE>, -1); ACE_SET_BITS (flags, M_DELETE_WRITER); } if (reader_q == 0) { ACE_NEW_RETURN (reader_q, ACE_Thru_Task<ACE_SYNCH_USE>, -1); ACE_SET_BITS (flags, M_DELETE_READER); } this->reader (reader_q); this->writer (writer_q); // Save the flags this->flags_ = flags; // Make sure that the memory is allocated before proceding. if (writer_q == 0 || reader_q == 0) { // These calls will delete writer_q and/or reader_q, if // necessary. this->close_i (0, M_DELETE_READER); this->close_i (1, M_DELETE_WRITER); errno = ENOMEM; return -1; } // Setup back pointers (this must come last, after we've made sure // there's memory allocated here. reader_q->mod_ = this; writer_q->mod_ = this; return 0;}
开发者ID:Xadras,项目名称:TBCPvP,代码行数:59,
示例2: ACE_BIT_ENABLEDintACE_Log_Msg_UNIX_Syslog::convert_log_mask (int lm_mask){ int syslog_mask = 0; if (ACE_BIT_ENABLED (lm_mask, LM_TRACE) || ACE_BIT_ENABLED (lm_mask, LM_DEBUG)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_DEBUG)); if (ACE_BIT_ENABLED (lm_mask, LM_STARTUP) || ACE_BIT_ENABLED (lm_mask, LM_SHUTDOWN) || ACE_BIT_ENABLED (lm_mask, LM_INFO)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_INFO)); if (ACE_BIT_ENABLED (lm_mask, LM_NOTICE)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_NOTICE)); if (ACE_BIT_ENABLED (lm_mask, LM_ERROR)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_ERR)); if (ACE_BIT_ENABLED (lm_mask, LM_WARNING)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_WARNING)); if (ACE_BIT_ENABLED (lm_mask, LM_CRITICAL)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_CRIT)); if (ACE_BIT_ENABLED (lm_mask, LM_ALERT)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_ALERT)); if (ACE_BIT_ENABLED (lm_mask, LM_EMERGENCY)) ACE_SET_BITS (syslog_mask, LOG_MASK(LOG_EMERG)); return syslog_mask;}
开发者ID:Denominator13,项目名称:NeoCore,代码行数:34,
示例3: ACE_SET_BITSintPriority_Task::open (void *arg){ this->priority_ = *(int *) arg; long flags = THR_NEW_LWP; // To get FIFO scheduling with PTHREADS. ACE_SET_BITS (flags, THR_SCHED_FIFO); // Become an active object. if (this->activate (flags, 1, 0, this->priority_) == -1) { // On Linux, for example, only the superuser can set the policy // to other than ACE_SCHED_OTHER. But with ACE_SCHED_OTHER, // there is only one thread priority value, for example, 0. So, // let the superuser run an interesting test, but for other // users use the minimum ACE_SCHED_OTHER thread priority. long fallback_priority = ACE_Sched_Params::priority_min (ACE_SCHED_OTHER, ACE_SCOPE_THREAD); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) task activation at priority %d with ") ACE_TEXT ("flags 0x%X failed; retry at priority %d with ") ACE_TEXT ("flags 0x%X (errno is %d%p)/n"), this->priority_, flags, fallback_priority, THR_NEW_LWP, ACE_ERRNO_GET, ACE_TEXT (""))); flags = THR_NEW_LWP; this->priority_ = fallback_priority; if (this->activate (flags, 1, 1, this->priority_) == -1) { if (ACE_OS::last_error () == EPERM) ACE_ERROR_RETURN ((LM_INFO, ACE_TEXT ("Insufficient privilege to run this test./n")), -1); else ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%t) task activation at priority %d failed, ") ACE_TEXT ("exiting!/n%a"), this->priority_, -1)); } } return 0;}
开发者ID:CCJY,项目名称:ACE,代码行数:60,
示例4: ACE_TRACEintACE_Flag_Manip::set_flags (ACE_HANDLE handle, int flags){ ACE_TRACE ("ACE_Flag_Manip::set_flags");#if defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_LACKS_FCNTL) switch (flags) { case ACE_NONBLOCK: // nonblocking argument (1) // blocking: (0) { u_long nonblock = 1; return ACE_OS::ioctl (handle, FIONBIO, &nonblock); } default: ACE_NOTSUP_RETURN (-1); }#else int val = ACE_OS::fcntl (handle, F_GETFL, 0); if (val == -1) return -1; // Turn on flags. ACE_SET_BITS (val, flags); if (ACE_OS::fcntl (handle, F_SETFL, val) == -1) return -1; else return 0;#endif /* ACE_WIN32 || ACE_LACKS_FCNTL */}
开发者ID:xkmld419,项目名称:crawl,代码行数:32,
示例5: ACE_TEXTvoidACE_Logging_Strategy::tokenize (ACE_TCHAR *flag_string){ ACE_TCHAR *strtokp; for (ACE_TCHAR *flag = ACE_OS::strtok_r (flag_string, ACE_TEXT ("|"), &strtokp); flag != 0; flag = ACE_OS::strtok_r (0, ACE_TEXT ("|"), &strtokp)) { if (ACE_OS::strcmp (flag, ACE_TEXT ("STDERR")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::STDERR); else if (ACE_OS::strcmp (flag, ACE_TEXT ("LOGGER")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::LOGGER); else if (ACE_OS::strcmp (flag, ACE_TEXT ("OSTREAM")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::OSTREAM); else if (ACE_OS::strcmp (flag, ACE_TEXT ("VERBOSE")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::VERBOSE); else if (ACE_OS::strcmp (flag, ACE_TEXT ("VERBOSE_LITE")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::VERBOSE_LITE); else if (ACE_OS::strcmp (flag, ACE_TEXT ("SILENT")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::SILENT); else if (ACE_OS::strcmp (flag, ACE_TEXT ("SYSLOG")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::SYSLOG); }}
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:27,
示例6: definedintGlobals::sched_fifo_init (void){#if defined (ACE_HAS_THREADS) // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.# if defined (_AIX) || defined (__APPLE__) || defined (BSD) int scope = ACE_SCOPE_THREAD;# else int scope = ACE_SCOPE_PROCESS;# endif /* _AIX */ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, SCHED_PRIORITY, scope))) { if (ACE_OS::last_error () == EPERM) { ACE_DEBUG ((LM_MAX, "User is not superuser, " "so remain in time-sharing class/n")); ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_NEW_LWP); GLOBALS::instance ()->default_priority = ACE_THR_PRI_OTHER_DEF; return 1; } else ACE_ERROR_RETURN ((LM_ERROR, "%n: ACE_OS::sched_params failed/n%a"), -1); } ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_BOUND); ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_SCHED_FIFO); GLOBALS::instance ()->default_priority = ACE_THR_PRI_FIFO_DEF; return 0;#else ACE_ERROR_RETURN ((LM_ERROR, "Test will not run. This platform doesn't seem to have threads./n"), -1);#endif /* ACE_HAS_THREADS */}
开发者ID:CCJY,项目名称:ATCD,代码行数:42,
示例7: ACE_SET_BITSintSender::initiate_io (ACE_Reactor_Mask mask){ if (ACE_BIT_ENABLED (flg_mask_, mask)) return 0; if (ACE_Reactor::instance ()->schedule_wakeup (this, mask) == -1) return -1; ACE_SET_BITS (flg_mask_, mask); return 0;}
开发者ID:azraelly,项目名称:knetwork,代码行数:12,
示例8: ACE_TRACEintACE_FoxReactor::remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask){ ACE_TRACE ("ACE_FoxReactor::remove_handler_i"); // In the registration phase we registered first with // ACE_Select_Reactor and then with X. Now we are now doing things // in reverse order. int condition = 0; if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, FX::INPUT_READ); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, FX::INPUT_WRITE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_SET_BITS (condition, FX::INPUT_EXCEPT); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) ACE_SET_BITS (condition, FX::INPUT_READ); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)) { ACE_SET_BITS (condition, FX::INPUT_WRITE); // connected, you may write ACE_SET_BITS (condition, FX::INPUT_READ); // connected, you have data/err } // First clean up the corresponding X11Input. fxapp->removeInput ((int)handle,condition); // ACE_reinterpret_cast(int,handle)); // Now let the reactor do its work. return ACE_Select_Reactor::remove_handler_i (handle, mask);}
开发者ID:07jkim,项目名称:TrinityCore,代码行数:31,
示例9: ACE_TRACEintACE_XtReactor::compute_Xt_condition(ACE_HANDLE handle){ ACE_TRACE ("ACE_XtReactor::compute_Xt_condition"); // Retrieve current wait mask from base class. // The returned value is either a combination of READ/WRITE/EXCEPT_MASK // or -1. int mask =this->bit_ops(handle, 0, this->wait_set_, ACE_Reactor::GET_MASK); if (mask == -1) // No active mask. return 0; int condition = 0;#if !defined ACE_WIN32 if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, XtInputReadMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, XtInputWriteMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_SET_BITS (condition, XtInputExceptMask);#else if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, XtInputReadWinsock); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, XtInputWriteWinsock); // EXCEPT_MASK is not supported for WIN32. As this was // already handled in register_handler_i, no check here.#endif /* !ACE_WIN32 */ return condition;}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:36,
示例10: ACE_SET_BITSvoidACE_Synch_Options::set (unsigned long options, const ACE_Time_Value &timeout, const void *arg){ // ACE_TRACE ("ACE_Synch_Options::set"); this->options_ = options; this->timeout_ = timeout; // Whoa, possible dependence on static initialization here. This // function is called during initialization of the statics above. // But, ACE_Time_Value::zero is a static object. Very fortunately, // its bits have a value of 0. if (this->timeout_ != ACE_Time_Value::zero) ACE_SET_BITS (this->options_, ACE_Synch_Options::USE_TIMEOUT); this->arg_ = arg;}
开发者ID:08keelr,项目名称:TrinityCore,代码行数:18,
示例11: ACE_DEBUGint KSG_Service_Handler::open(){ this->request_time_ = ACE_OS::gettimeofday(); this->connect_time_ = this->request_time_; char val[2] = ""; int len = 1; val[0] = 0x1; if(ACE_OS::setsockopt(peer().get_handle(),SOL_SOCKET,TCP_NODELAY,val,len)!=0) ACE_DEBUG((LM_ERROR,"创建新连接,设置属性失败")); // 准备读取数据 if(this->reactor()->register_handler(this,ACE_Event_Handler::READ_MASK)) { ACE_DEBUG((LM_ERROR,"注册侦听句柄失败")); return -1; } ACE_Time_Value reschedule (max_client_timeout_.sec () / 4); reactor()->schedule_timer(this,0,max_client_timeout_,reschedule); ACE_SET_BITS(this->mask_,ACE_Event_Handler::READ_MASK); return 0;}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:20,
示例12: ACE_TRACEtemplate <ACE_SYNCH_DECL, class TIME_POLICY> voidACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *q, int flags /* = M_DELETE_WRITER */){ ACE_TRACE ("ACE_Module<ACE_SYNCH_USE, TIME_POLICY>::writer"); // Close and maybe delete old writer this->close_i (1, flags); this->q_pair_[1] = q; if (q != 0) { ACE_CLR_BITS (q->flags_, ACE_Task_Flags::ACE_READER); // Set the q's module pointer to point to us. q->mod_ = this; } // Don't allow the caller to change the reader status. ACE_SET_BITS (flags_, (flags & M_DELETE_WRITER));}
开发者ID:Bootz,项目名称:SkyFire_one,代码行数:21,
示例13: ACE_TRACEACE_BEGIN_VERSIONED_NAMESPACE_DECL// Flags are file status flags to turn on.intACE::set_flags (ACE_HANDLE handle, int flags){ ACE_TRACE ("ACE::set_flags");#if defined (ACE_LACKS_FCNTL) switch (flags) { case ACE_NONBLOCK: // nonblocking argument (1) // blocking: (0) { int nonblock = 1; return ACE_OS::ioctl (handle, FIONBIO, &nonblock); } default: ACE_NOTSUP_RETURN (-1); }#else int val = ACE_OS::fcntl (handle, F_GETFL, 0); if (val == -1) return -1; // Turn on flags. ACE_SET_BITS (val, flags); if (ACE_OS::fcntl (handle, F_SETFL, val) == -1) return -1; else return 0;#endif /* ACE_LACKS_FCNTL */}
开发者ID:CCJY,项目名称:ACE,代码行数:36,
示例14: getopt//.........这里部分代码省略......... { int n = ACE_OS::atoi (getopt.opt_arg ()); // I'm assuming 0 means unlimited, so just use whatever the // user provides. Seems to work okay on Solaris 5.8. if (IP_MAX_MEMBERSHIPS == 0) this->groups_ = n; else this->groups_ = ACE_MIN (ACE_MAX (n, MCT_MIN_GROUPS), IP_MAX_MEMBERSHIPS); break; } case 'd': this->debug_ = 1; break; case 'r': { ACE_TCHAR *c = getopt.opt_arg (); if (ACE_OS::strcasecmp (c, ACE_TEXT ("CONSUMER")) == 0) this->role_ = CONSUMER; else if (ACE_OS::strcasecmp (c, ACE_TEXT ("PRODUCER")) == 0) this->role_ = PRODUCER; else { help = 1; retval = -1; } } break; case 'm': { //@todo add back OPT_BINDADDR_NO... ACE_TCHAR *c = getopt.opt_arg (); if (ACE_OS::strcasecmp (c, ACE_TEXT ("OPT_BINDADDR_YES")) == 0) ACE_SET_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_BINDADDR_YES); else if (ACE_OS::strcasecmp (c, ACE_TEXT ("OPT_BINDADDR_NO")) == 0) ACE_CLR_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_BINDADDR_YES); else if (ACE_OS::strcasecmp (c, ACE_TEXT ("DEFOPT_BINDADDR")) == 0) { ACE_CLR_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_BINDADDR_YES); ACE_SET_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::DEFOPT_BINDADDR); } else if (ACE_OS::strcasecmp (c, ACE_TEXT ("OPT_NULLIFACE_ALL")) == 0) ACE_SET_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_NULLIFACE_ALL); else if (ACE_OS::strcasecmp (c, ACE_TEXT ("OPT_NULLIFACE_ONE")) == 0) ACE_CLR_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_NULLIFACE_ALL); else if (ACE_OS::strcasecmp (c, ACE_TEXT ("DEFOPT_NULLIFACE")) == 0) { ACE_CLR_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::OPT_NULLIFACE_ALL); ACE_SET_BITS (this->sdm_opts_, ACE_SOCK_Dgram_Mcast::DEFOPT_NULLIFACE); } else if (ACE_OS::strcasecmp (c, ACE_TEXT ("DEFOPTS")) == 0) this->sdm_opts_ = ACE_SOCK_Dgram_Mcast::DEFOPTS; else { help = 1; retval = -1; } }
开发者ID:CCJY,项目名称:ACE,代码行数:67,
示例15: ACE_TRACEintACE_TkReactor::register_handler_i (ACE_HANDLE handle, ACE_Event_Handler *handler, ACE_Reactor_Mask mask){ ACE_TRACE ("ACE_TkReactor::register_handler_i"); int result = ACE_Select_Reactor::register_handler_i (handle, handler, mask); if (result == -1) return -1; int condition = 0;#if !defined ACE_WIN32 if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, TK_READABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, TK_WRITABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_SET_BITS (condition, TK_EXCEPTION); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) ACE_SET_BITS (condition, TK_READABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ ACE_SET_BITS (condition, TK_READABLE); // connected, you may write ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err }#else if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, TK_READABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, TK_WRITABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_NOTSUP_RETURN(-1); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) ACE_SET_BITS (condition, TK_READABLE); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ ACE_SET_BITS (condition, TK_READABLE); // connected, you may write ACE_SET_BITS (condition, TK_WRITABLE); // connected, you have data/err }#endif /* !ACE_WIN32 */ if (condition != 0) { ACE_TkReactorID *TkID = this->ids_; while(TkID) { if (TkID->handle_ == handle) { ::Tk_DeleteFileHandler (TkID->handle_); ACE_TkReactor_Input_Callback *callback; ACE_NEW_RETURN (callback, ACE_TkReactor_Input_Callback, -1); callback->reactor_ = this; callback->handle_ = handle; ::Tk_CreateFileHandler ((int) handle, condition, InputCallbackProc, (ClientData) callback); return 0; } else TkID = TkID->next_; } ACE_NEW_RETURN (TkID, ACE_TkReactorID, -1); TkID->next_ = this->ids_; TkID->handle_ = handle; ACE_TkReactor_Input_Callback *callback; ACE_NEW_RETURN (callback, ACE_TkReactor_Input_Callback, -1); callback->reactor_ = this; callback->handle_ = handle; ::Tk_CreateFileHandler ((int) handle, condition, InputCallbackProc, (ClientData) callback); this->ids_ = TkID; } return 0;}
开发者ID:CCJY,项目名称:ACE,代码行数:88,
示例16: ACE_TRACEintACE_Logging_Strategy::parse_args (int argc, ACE_TCHAR *argv[]){ ACE_TRACE ("ACE_Logging_Strategy::parse_args"); ACE_TCHAR *temp; // Perform data member initializations. BTW, do *not* initialize // <thread_priority_mask_> or <process_priority_mask_> here to avoid // unduing the behavior in <init>, where these are set by // <ACE_Log_Msg::instance>. this->flags_ = 0; this->wipeout_logfile_ = false; this->count_ = 0; this->fixed_number_ = false; this->order_files_ = false; this->max_file_number_ = 1; this->interval_ = ACE_DEFAULT_LOGFILE_POLL_INTERVAL; this->max_size_ = 0; ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("f:i:k:m:n:N:op:s:t:w"), 0); for (int c; (c = get_opt ()) != -1; ) { switch (c) { case 'f': temp = get_opt.opt_arg (); // Now tokenize the string to get all the flags this->tokenize (temp); // If LOGGER was specified, set up the default logger key. // The key can be changed by the -k option also, so if it's // been set already, don't set it. if (ACE_BIT_ENABLED (this->flags_, ACE_Log_Msg::LOGGER) && this->logger_key_ == 0) this->logger_key_ = ACE::strnew (ACE_DEFAULT_LOGGER_KEY); break; case 'i': // Interval (in secs) at which logfile size is sampled. this->interval_ = ACE_OS::strtoul (get_opt.opt_arg (), 0, 10); break; case 'k': // Ensure that the LOGGER flag is set ACE_SET_BITS (this->flags_, ACE_Log_Msg::LOGGER); delete [] this->logger_key_; this->logger_key_ = ACE::strnew (get_opt.opt_arg ()); break; case 'm': // Maximum logfile size (in KB). Must be a non-zero value. this->max_size_ = ACE_OS::strtoul (get_opt.opt_arg (), 0, 10); this->max_size_ <<= 10; // convert from KB to bytes. break; case 'n': delete [] this->program_name_; this->program_name_ = ACE::strnew (get_opt.opt_arg ()); break; case 'N': // The max number for the log_file being created this->max_file_number_ = ACE_OS::atoi (get_opt.opt_arg ()) - 1; this->fixed_number_ = true; break; case 'o': // Log_files generation order this->order_files_ = true; break; case 'p': temp = get_opt.opt_arg (); // Now tokenize the string to setup process log priority this->priorities (temp, ACE_Log_Msg::PROCESS); break; case 's': // Ensure that the OSTREAM flag is set ACE_SET_BITS (this->flags_, ACE_Log_Msg::OSTREAM); delete [] this->filename_; this->filename_ = ACE::strnew (get_opt.opt_arg ()); break; case 't': temp = get_opt.opt_arg (); // Now tokenize the string to setup thread log priority this->priorities (temp, ACE_Log_Msg::THREAD); break; case 'w': // Cause the logfile to be wiped out, both on startup and on // reconfigure. this->wipeout_logfile_ = true; break; default: break; } } return 0;}
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:92,
示例17: ACE_TRACEintACE_Service_Gestalt::open_i (const ACE_TCHAR program_name[], const ACE_TCHAR* logger_key, bool ignore_static_svcs, bool ignore_default_svc_conf_file, bool ignore_debug_flag){ ACE_TRACE ("ACE_Service_Gestalt::open_i"); int result = 0; ACE_Log_Msg *log_msg = ACE_LOG_MSG; this->no_static_svcs_ = ignore_static_svcs; // Record the current log setting upon entering this thread. u_long old_process_mask = log_msg->priority_mask (ACE_Log_Msg::PROCESS); u_long old_thread_mask = log_msg->priority_mask (ACE_Log_Msg::THREAD);#ifndef ACE_NLOGGING if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) SG::open_i - this=%@, ") ACE_TEXT ("opened=%d, loadstatics=%d/n"), this, this->is_opened_, this->no_static_svcs_));#endif // Guard against reentrant processing. For example, // if the singleton gestalt (ubergestalt) was already open, // do not open it again... if (this->is_opened_++ != 0) return 0; if (this->init_i () != 0) return -1; u_long flags = log_msg->flags (); // Only use STDERR if the caller hasn't already set the flags. if (flags == 0) flags = (u_long) ACE_Log_Msg::STDERR; const ACE_TCHAR *key = logger_key; if (key == 0 || ACE_OS::strcmp (key, ACE_DEFAULT_LOGGER_KEY) == 0) { // Only use the static <logger_key_> if the caller doesn't // override it in the parameter list or if the key supplied is // equal to the default static logger key. key = this->logger_key_; } else { ACE_SET_BITS (flags, ACE_Log_Msg::LOGGER); } if (log_msg->open (program_name, flags, key) == -1) return -1; if (!ignore_debug_flag) { // If -d was included as a startup parameter, the user wants debug // information printed during service initialization. if (ACE::debug ()) ACE_Log_Msg::enable_debug_messages (); else // The user has requested no debugging info. ACE_Log_Msg::disable_debug_messages (); } // See if we need to load the static services. if (this->no_static_svcs_ == 0 && this->load_static_svcs () == -1) result = -1; else { if (this->process_directives (ignore_default_svc_conf_file) == -1) result = -1; else result = this->process_commandline_directives (); } // Reset debugging back to the way it was when we came into // into <open_i>. { // Make sure to save/restore errno properly. ACE_Errno_Guard error (errno); if (!ignore_debug_flag) { log_msg->priority_mask (old_process_mask, ACE_Log_Msg::PROCESS); log_msg->priority_mask (old_thread_mask, ACE_Log_Msg::THREAD); } } return result;//.........这里部分代码省略.........
开发者ID:Archives,项目名称:ro_core,代码行数:101,
示例18: ACE_TRACEintACE_XtReactor::register_handler_i (ACE_HANDLE handle, ACE_Event_Handler *handler, ACE_Reactor_Mask mask){ ACE_TRACE ("ACE_XtReactor::register_handler_i"); // Make sure we have a valid context ACE_ASSERT (this->context_ != 0); int result = ACE_Select_Reactor::register_handler_i (handle, handler, mask); if (result == -1) return -1; int condition = 0;#if !defined ACE_WIN32 if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, XtInputReadMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, XtInputWriteMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_SET_BITS (condition, XtInputExceptMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) ACE_SET_BITS (condition, XtInputReadMask); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ ACE_SET_BITS (condition, XtInputWriteMask); // connected, you may write ACE_SET_BITS (condition, XtInputReadMask); // connected, you have data/err }#else if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK)) ACE_SET_BITS (condition, XtInputReadWinsock); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) ACE_SET_BITS (condition, XtInputWriteWinsock); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) ACE_NOTSUP_RETURN(-1); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) ACE_SET_BITS (condition, XtInputReadWinsock); if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)){ ACE_SET_BITS (condition, XtInputWriteWinsock); // connected, you may write ACE_SET_BITS (condition, XtInputReadWinsock); // connected, you have data/err }#endif /* !ACE_WIN32 */ if (condition != 0) { ACE_XtReactorID *XtID = this->ids_; while(XtID) { if (XtID->handle_ == handle) { ::XtRemoveInput (XtID->id_); XtID->id_ = ::XtAppAddInput (this->context_, (int) handle, (XtPointer) condition, InputCallbackProc, (XtPointer) this); return 0; } else XtID = XtID->next_; } ACE_NEW_RETURN (XtID, ACE_XtReactorID, -1); XtID->next_ = this->ids_; XtID->handle_ = handle; XtID->id_ = ::XtAppAddInput (this->context_, (int) handle, (XtPointer) condition, InputCallbackProc, (XtPointer) this); this->ids_ = XtID; } return 0;}
开发者ID:binghuo365,项目名称:BaseLab,代码行数:80,
示例19: ACE_TRACEintACE_Service_Config::open_i (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key, bool , bool , bool ){ ACE_TRACE ("ACE_Service_Config::open_i"); ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1)); ACE_Log_Msg *log_msg = ACE_LOG_MSG; if(ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) SC::open_i - this=%@, opened=%d/n"), this, this->is_opened_)); // Guard against reentrant processing. if(this->is_opened_) return 0; this->is_opened_ = true; // Check for things we need to do on a per-process basis and which // may not be safe, or wise to do an a per instance basis // Become a daemon before doing anything else. if(ACE_Service_Config::be_a_daemon_) ACE::daemonize (); // Write process id to file. if(this->pid_file_name_ != 0) { FILE* pidf = ACE_OS::fopen (this->pid_file_name_, ACE_TEXT("w")); if(pidf != 0) { ACE_OS::fprintf (pidf, "%ld/n", static_cast<long> (ACE_OS::getpid())); ACE_OS::fclose (pidf); } } u_long flags = log_msg->flags (); // Only use STDERR if the caller hasn't already set the flags. if(flags == 0) flags = (u_long) ACE_Log_Msg::STDERR; const ACE_TCHAR *key = logger_key; if(key == 0 || ACE_OS::strcmp (key, ACE_DEFAULT_LOGGER_KEY) == 0) { // Only use the static <logger_key_> if the caller doesn't // override it in the parameter list or if the key supplied is // equal to the default static logger key. key = ACE_Service_Config::current()->logger_key_; } else { ACE_SET_BITS (flags, ACE_Log_Msg::LOGGER); } if(log_msg->open (program_name, flags, key) == -1) return -1; if(ACE::debug ()) ACE_DEBUG ((LM_STARTUP, ACE_TEXT ("starting up daemon %n/n"))); // Initialize the Service Repository (this will still work if // user forgets to define an object of type ACE_Service_Config). ACE_Service_Repository::instance (ACE_Service_Gestalt::MAX_SERVICES); // Initialize the ACE_Reactor (the ACE_Reactor should be the // same size as the ACE_Service_Repository). ACE_Reactor::instance (); // 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) // Only attempt to register a signal handler for positive // signal numbers. if(ACE_Service_Config::signum_ > 0) { ACE_Sig_Set ss; ss.sig_add (ACE_Service_Config::signum_); if((ACE_Reactor::instance () != 0) && (ACE_Reactor::instance ()->register_handler (ss, ACE_Service_Config::signal_handler_) == -1)) ACE_ERROR ((LM_ERROR, ACE_TEXT ("can't register signal handler/n"))); }#endif /* ACE_LACKS_UNIX_SIGNALS */ return 0;//.........这里部分代码省略.........
开发者ID:Desch,项目名称:MythCore,代码行数:101,
示例20: base_addr_ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool ( const ACE_TCHAR *backing_store_name, const OPTIONS *options) : base_addr_ (0), use_fixed_addr_(0), flags_ (MAP_SHARED), write_each_page_ (false), minimum_bytes_ (0), sa_ (0), file_mode_ (ACE_DEFAULT_FILE_PERMS), install_signal_handler_ (true){ ACE_TRACE ("ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool");#if (defined (ACE_HAS_SIGINFO_T) && !defined (ACE_LACKS_SI_ADDR)) || defined (ACE_WIN32) // For plaforms that give the faulting address. guess_on_fault_ = false;#else // For plaforms that do NOT give the faulting address, let the // options decide whether to guess or not. if (options) guess_on_fault_ = options->guess_on_fault_; else // If no options are specified, default to true. guess_on_fault_ = true;#endif /* (defined (ACE_HAS_SIGINFO_T) && !defined (ACE_LACKS_SI_ADDR)) || defined (ACE_WIN32) */ // Only change the defaults if <options> != 0. if (options) { if (options->flags_ != 0) this->flags_ = options->flags_; use_fixed_addr_ = options->use_fixed_addr_; if (use_fixed_addr_ == ACE_MMAP_Memory_Pool_Options::ALWAYS_FIXED) { this->base_addr_ = const_cast<void *> (options->base_addr_); ACE_SET_BITS (flags_, MAP_FIXED); } this->write_each_page_ = options->write_each_page_; this->minimum_bytes_ = options->minimum_bytes_; if (options->sa_ != 0) this->sa_ = options->sa_; this->file_mode_ = options->file_mode_; this->install_signal_handler_ = options->install_signal_handler_; } if (backing_store_name == 0) { // Only create a new unique filename for the backing store file // if the user didn't supply one...#if defined (ACE_DEFAULT_BACKING_STORE) // Create a temporary file. ACE_OS::strcpy (this->backing_store_name_, ACE_DEFAULT_BACKING_STORE);#else /* ACE_DEFAULT_BACKING_STORE */ if (ACE::get_temp_dir (this->backing_store_name_, 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->backing_store_name_[0] = 0; } // Add the filename to the end ACE_OS::strcat (this->backing_store_name_, ACE_TEXT ("ace-malloc-XXXXXX")); // If requested an unique filename, use mktemp to get a random file. if (options && options->unique_)# if defined (ACE_DISABLE_MKTEMP) { ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("mktemp disabled; ") ACE_TEXT ("can't generate unique name"))); this->backing_store_name_[0] = 0; }# else ACE_OS::mktemp(this->backing_store_name_);# endif /* ACE_DISABLE_MKTEMP */#endif /* ACE_DEFAULT_BACKING_STORE */ } else ACE_OS::strsncpy (this->backing_store_name_, backing_store_name, (sizeof this->backing_store_name_ / sizeof (ACE_TCHAR)));#if !defined (ACE_WIN32) if (this->install_signal_handler_) { if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) ACELIB_ERROR ((LM_ERROR, ACE_TEXT("%p/n"), this->backing_store_name_)); }#endif /* ACE_WIN32 */}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:98,
示例21: ACE_TRACE// Perform GET, CLR, SET, and ADD operations on the Handle_Sets.//// GET = 1, Retrieve current value// SET = 2, Set value of bits to new mask (changes the entire mask)// ADD = 3, Bitwise "or" the value into the mask (only changes// enabled bits)// CLR = 4 Bitwise "and" the negation of the value out of the mask// (only changes enabled bits)//// Returns the original mask. Must be called with locks held.intACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Select_Reactor_Handle_Set &handle_set, int ops){ ACE_TRACE ("ACE_Select_Reactor_Impl::bit_ops"); if (this->handler_rep_.handle_in_range (handle) == 0) return -1;#if !defined (ACE_WIN32) ACE_Sig_Guard sb (0, this->mask_signals_); // Block out all signals until method returns.#endif /* ACE_WIN32 */ ACE_FDS_PTMF ptmf = &ACE_Handle_Set::set_bit; u_long omask = ACE_Event_Handler::NULL_MASK; // Find the old reactor masks. This automatically does the work of // the GET_MASK operation. if (handle_set.rd_mask_.is_set (handle)) ACE_SET_BITS (omask, ACE_Event_Handler::READ_MASK); if (handle_set.wr_mask_.is_set (handle)) ACE_SET_BITS (omask, ACE_Event_Handler::WRITE_MASK); if (handle_set.ex_mask_.is_set (handle)) ACE_SET_BITS (omask, ACE_Event_Handler::EXCEPT_MASK); switch (ops) { case ACE_Reactor::GET_MASK: // The work for this operation is done in all cases at the // begining of the function. break; case ACE_Reactor::CLR_MASK: ptmf = &ACE_Handle_Set::clr_bit; // State was changed. we need to reflect that change in the // dispatch_mask I assume that only ACE_Reactor::CLR_MASK should // be treated here which means we need to clear the handle|mask // from the current dispatch handler this->clear_dispatch_mask (handle, mask); /* FALLTHRU */ case ACE_Reactor::SET_MASK: /* FALLTHRU */ case ACE_Reactor::ADD_MASK: // The following code is rather subtle... Note that if we are // doing a ACE_Reactor::SET_MASK then if the bit is not enabled // in the mask we need to clear the bit from the ACE_Handle_Set. // On the other hand, if we are doing a ACE_Reactor::CLR_MASK or // a ACE_Reactor::ADD_MASK we just carry out the operations // specified by the mask. // READ, ACCEPT, and CONNECT flag will place the handle in the // read set. if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK) || ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK) || ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)) { (handle_set.rd_mask_.*ptmf) (handle); } else if (ops == ACE_Reactor::SET_MASK) handle_set.rd_mask_.clr_bit (handle); // WRITE and CONNECT flag will place the handle in the write set if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK) || ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)) { (handle_set.wr_mask_.*ptmf) (handle); } else if (ops == ACE_Reactor::SET_MASK) handle_set.wr_mask_.clr_bit (handle); // EXCEPT (and CONNECT on Win32) flag will place the handle in // the except set. if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)#if defined (ACE_WIN32) || ACE_BIT_ENABLED (mask, ACE_Event_Handler::CONNECT_MASK)#endif /* ACE_WIN32 */ ) { (handle_set.ex_mask_.*ptmf) (handle); } else if (ops == ACE_Reactor::SET_MASK) handle_set.ex_mask_.clr_bit (handle); break; default: return -1; }//.........这里部分代码省略.........
开发者ID:Dudelzack,项目名称:blizzlikecore,代码行数:101,
示例22: ssl_acceptor_TAO_BEGIN_VERSIONED_NAMESPACE_DECLTAO::SSLIOP::Acceptor::Acceptor (::Security::QOP qop, const ACE_Time_Value & timeout) : TAO::IIOP_SSL_Acceptor (), ssl_acceptor_ (this), creation_strategy_ (0), concurrency_strategy_ (0), accept_strategy_ (0), timeout_ (timeout){ // --- CSIv1 --- // Clear all bits in the SSLIOP::SSL association option fields. this->ssl_component_.target_supports = 0; this->ssl_component_.target_requires = 0; // SSLIOP requires these Security::AssociationOptions by default. ACE_SET_BITS (this->ssl_component_.target_requires, ::Security::Integrity | ::Security::Confidentiality | ::Security::NoDelegation); // SSLIOP supports these Security::AssociationOptions by default. ACE_SET_BITS (this->ssl_component_.target_supports, ::Security::Integrity | ::Security::Confidentiality | ::Security::EstablishTrustInTarget | ::Security::NoDelegation); // Initialize the default SSL port to zero (wild card port). this->ssl_component_.port = 0; // @@ This should go away once we support setting security // association options through policies. if (qop == ::Security::SecQOPNoProtection) ACE_SET_BITS (this->ssl_component_.target_supports, ::Security::NoProtection); // --- CSIv2 --- // Clear all bits in the CSIIOP::TLS_SEC_TRANS association option // fields. this->csiv2_component_.target_supports = 0; this->csiv2_component_.target_requires = 0; // SSLIOP requires these CSIIOP::AssociationOptions by default. ACE_SET_BITS (this->csiv2_component_.target_requires, CSIIOP::Integrity | CSIIOP::Confidentiality | CSIIOP::NoDelegation); // SSLIOP supports these CSIIOP::AssociationOptions by default. ACE_SET_BITS (this->csiv2_component_.target_supports, CSIIOP::Integrity | CSIIOP::Confidentiality | CSIIOP::EstablishTrustInTarget | CSIIOP::NoDelegation); // @@ This should go away once we support setting security // association options through policies. if (qop == CSIIOP::NoProtection) ACE_SET_BITS (this->csiv2_component_.target_supports, CSIIOP::NoProtection);}
开发者ID:CCJY,项目名称:ATCD,代码行数:66,
示例23: ACE_STATIC_SERVICE_DIRECTIVEintTAO::SSLIOP::Protocol_Factory::init (int argc, ACE_TCHAR* argv[]){ char *certificate_path = 0; char *private_key_path = 0; char *dhparams_path = 0; char *ca_file = 0; CORBA::String_var ca_dir; ACE_TCHAR *rand_path = 0; int certificate_type = -1; int private_key_type = -1; int dhparams_type = -1; int prevdebug = -1; CSIIOP::AssociationOptions csiv2_target_supports = CSIIOP::Integrity | CSIIOP::Confidentiality; CSIIOP::AssociationOptions csiv2_target_requires = CSIIOP::Integrity | CSIIOP::Confidentiality; // Force the Singleton instance to be initialized/instantiated. // Some SSLIOP option combinations below will result in the // Singleton instance never being initialized. In that case, // problems may occur later on due to lack of initialization of the // underlying SSL library (e.g. OpenSSL), which occurs when an // ACE_SSL_Context is instantiated. // This directive processing initializes ACE_SSL_Context as well // as registers ACE_SSL for correct cleanup. ACE_Service_Config::process_directive ( ACE_STATIC_SERVICE_DIRECTIVE ("ACE_SSL_Initializer", "")); // The code is cleaner this way anyway. ACE_SSL_Context * ssl_ctx = ACE_SSL_Context::instance (); size_t session_id_len = (sizeof session_id_context_ >= SSL_MAX_SSL_SESSION_ID_LENGTH) ? SSL_MAX_SSL_SESSION_ID_LENGTH : sizeof session_id_context_; // Note that this function returns 1, if the operation succeded. // See SSL_CTX_set_session_id_context(3) if( 1 != ::SSL_CTX_set_session_id_context (ssl_ctx->context(), session_id_context_, session_id_len)) { if (TAO_debug_level > 0) ORBSVCS_ERROR ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Unable to set the session id ") ACE_TEXT ("context to /'%C/'/n"), session_id_context_)); return -1; } for (int curarg = 0; curarg != argc; ++curarg) { if ((ACE_OS::strcasecmp (argv[curarg], ACE_TEXT("-verbose")) == 0) || (ACE_OS::strcasecmp (argv[curarg], ACE_TEXT("-v")) == 0)) { if (TAO_debug_level == 0) { prevdebug = TAO_debug_level; TAO_debug_level = 1; } } else if (ACE_OS::strcasecmp (argv[curarg], ACE_TEXT("-SSLNoProtection")) == 0) { // Enable the eNULL cipher. Note that enabling the "eNULL" // cipher only disables encryption. However, certificate // exchanges will still occur. if (::SSL_CTX_set_cipher_list (ssl_ctx->context (), "ALL:eNULL") == 0) { ORBSVCS_DEBUG ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Unable to set eNULL ") ACE_TEXT ("SSL cipher in SSLIOP ") ACE_TEXT ("factory./n"))); return -1; } // This does not disable secure invocations on the server // side. It merely enables insecure ones. On the client // side, secure invocations will be disabled unless // overridden by a SecurityLevel2::QOPPolicy in the object // reference. this->qop_ = ::Security::SecQOPNoProtection; ACE_SET_BITS (csiv2_target_supports, CSIIOP::NoProtection); ACE_CLR_BITS (csiv2_target_requires, CSIIOP::Confidentiality); }//.........这里部分代码省略.........
开发者ID:asdlei00,项目名称:ACE,代码行数:101,
示例24: ACE_SET_BITSvoidCubit_Client::disable_test (u_int mask){ ACE_SET_BITS (this->test_disable_bitset_, mask);}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:5,
示例25: ACE_TRACEintACE_Service_Gestalt::open_i (const ACE_TCHAR program_name[], const ACE_TCHAR* logger_key, bool ignore_static_svcs, bool ignore_default_svc_conf_file, bool ignore_debug_flag){ ACE_TRACE ("ACE_Service_Gestalt::open_i"); int result = 0; ACE_Log_Msg *log_msg = ACE_LOG_MSG; this->no_static_svcs_ = ignore_static_svcs; // Record the current log setting upon entering this thread. u_long old_process_mask = log_msg->priority_mask (ACE_Log_Msg::PROCESS); u_long old_thread_mask = log_msg->priority_mask (ACE_Log_Msg::THREAD);#ifndef ACE_NLOGGING if (ACE::debug ()) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) SG::open_i - this=%@, ") ACE_TEXT ("opened=%d, loadstatics=%d/n"), this, this->is_opened_, this->no_static_svcs_));#endif // Guard against reentrant processing. For example, // if the singleton gestalt (ubergestalt) was already open, // do not open it again... if (this->is_opened_++ != 0) return 0; if (this->init_i () != 0) return -1; u_long flags = log_msg->flags (); // Only use STDERR if the caller hasn't already set the flags. if (flags == 0) flags = (u_long) ACE_Log_Msg::STDERR; const ACE_TCHAR *key = logger_key; if (key == 0 || ACE_OS::strcmp (key, ACE_DEFAULT_LOGGER_KEY) == 0) { // Only use the static <logger_key_> if the caller doesn't // override it in the parameter list or if the key supplied is // equal to the default static logger key. key = this->logger_key_; } else { ACE_SET_BITS (flags, ACE_Log_Msg::LOGGER); } if (log_msg->open (program_name, flags, key) == -1) return -1; if (!ignore_debug_flag) { // If -d was included as a startup parameter, the user wants debug // information printed during service initialization. if (ACE::debug ()) ACE_Log_Msg::enable_debug_messages (); else // The user has requested no debugging info. ACE_Log_Msg::disable_debug_messages (); } if (!ignore_default_svc_conf_file) { bool add_default = true; bool has_files = this->svc_conf_file_queue_ && !this->svc_conf_file_queue_->is_empty (); bool has_cmdline = this->svc_queue_ && !this->svc_queue_->is_empty (); if (has_files || has_cmdline) { // check if default file is already listed ACE_TString *sptr = 0; ACE_TString default_svc_conf (ACE_DEFAULT_SVC_CONF); for (ACE_SVC_QUEUE_ITERATOR iter (*this->svc_conf_file_queue_); iter.next (sptr) != 0 && add_default; iter.advance ()) { add_default = (*sptr != default_svc_conf); } if (add_default) { FILE *fp = ACE_OS::fopen (ACE_DEFAULT_SVC_CONF, ACE_TEXT ("r")); if (fp != 0) ACE_OS::fclose(fp); else add_default = false;//.........这里部分代码省略.........
开发者ID:Adeer,项目名称:OregonCore,代码行数:101,
注:本文中的ACE_SET_BITS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACE_SVC_NAME函数代码示例 C++ ACE_REGISTRY_CALL_RETURN函数代码示例 |