本文整理汇总了C++中OS_REPORT_1函数的典型用法代码示例。如果您正苦于以下问题:C++ OS_REPORT_1函数的具体用法?C++ OS_REPORT_1怎么用?C++ OS_REPORT_1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OS_REPORT_1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: d_storeMMFKernelAttach
d_storeMMFKernel
d_storeMMFKernelAttach (
c_base base,
const c_char *name)
{
d_storeMMFKernel kernel = NULL;
if (name == NULL) {
OS_REPORT(OS_ERROR,
"d_storeMMFKernelAttach",0,
"Failed to lookup kernel, specified kernel name = <NULL>");
} else {
kernel = c_lookup(base,name);
if (kernel == NULL) {
OS_REPORT_1(OS_ERROR,
"d_storeMMFKernelAttach",0,
"Failed to lookup kernel '%s' in Database",
name);
} else if (c_checkType(kernel,"d_storeMMFKernel") != kernel) {
c_free(kernel);
kernel = NULL;
OS_REPORT_1(OS_ERROR,
"d_storeMMFKernelAttach",0,
"Object '%s' is apparently not of type 'd_storeMMFKernel'",
name);
}
}
return kernel;
}
示例2: cfgGetArguments
static c_bool
cfgGetArguments(
sr_serviceInfo si,
u_cfElement info)
{
c_iter iter;
int iterLength;
c_bool r;
u_cfData d;
r = TRUE;
iter = u_cfElementXPath(info, "Arguments/#text");
iterLength = c_iterLength(iter);
d = u_cfData(c_iterTakeFirst(iter));
if (iterLength == 1) {
r = u_cfDataStringValue(d, &si->args);
u_cfDataFree(d);
} else if (iterLength == 0) {
OS_REPORT_1(OS_INFO, OSRPT_CNTXT_SPLICED,
0, "Taking default for <Arguments> parameter service %s", si->name);
si->args = os_strdup("");
} else {
OS_REPORT_1(OS_ERROR, OSRPT_CNTXT_SPLICED,
0, "One <Arguments> parameter expected for service %s", si->name);
si->args = os_strdup("");
while (d != NULL) {
u_cfDataFree(d);
d = u_cfData(c_iterTakeFirst(iter));
}
r = FALSE;
}
c_iterFree(iter);
return r;
}
示例3: serviceStateExpired
void
serviceStateExpired(
v_leaseAction leaseAction)
{
v_object o;
v_handleResult r;
assert(leaseAction != NULL);
assert(C_TYPECHECK(leaseAction, v_leaseAction));
r = v_handleClaim(leaseAction->actionObject, &o);
if (r == V_HANDLE_OK)
{
if (o->kind == K_SERVICESTATE)
{
v_serviceStateChangeState(v_serviceState(o), STATE_DIED);
} else
{
OS_REPORT_1(OS_WARNING, "v_leaseManager", 0,
"Lease action on unexpected object type: %d", o->kind);
}
r = v_handleRelease(leaseAction->actionObject);
if(r != V_HANDLE_OK)
{
OS_REPORT_1(OS_WARNING, "v_leaseManager", 0,
"Handle release failed with result code %d ", r);
}
} /* else just skip, since entity is already gone */
}
示例4: cms_soapThreadRun
static void*
cms_soapThreadRun(
void *thr)
{
cms_soapThread thread;
struct soap* soap;
c_char* result;
thread = cms_soapThread(thr);
os_mutexLock(&thread->soapMutex);
while(cms_thread(thread)->terminate == FALSE){
if(thread->soap != NULL){
soap = thread->soap;
thread->soap = NULL;
cms_thread(thread)->results = NULL;
soap->user = thr;
soap_serve(soap);
soap_destroy(soap);
soap_end(soap);
soap_done(soap);
free(soap);
u_entityAction( u_entity(thread->client->service->uservice),
cms_soapThreadStatisticsRequestHandledAdd,
thread->client->service);
if(cms_thread(thread)->results != NULL){
result = (c_char*)(c_iterTakeFirst(cms_thread(thread)->results));
while(result){
os_free(result);
result = (c_char*)(c_iterTakeFirst(cms_thread(thread)->results));
}
c_iterFree(cms_thread(thread)->results);
cms_thread(thread)->results = NULL;
}
}
if(cms_thread(thread)->terminate == FALSE){
cms_thread(thread)->ready = TRUE;
if(thread->client->service->configuration->verbosity >= 7){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' ready.", cms_thread(thread)->name);
}
os_condWait(&thread->condition, &thread->soapMutex);
if(thread->client->service->configuration->verbosity >= 7){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' condition triggered.", cms_thread(thread)->name);
}
}
}
os_mutexUnlock(&thread->soapMutex);
if(thread->client->service->configuration->verbosity >= 6){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' ends.", cms_thread(thread)->name);
}
return NULL;
}
示例5: os_procAttrGetClass
/** \brief Get the process effective scheduling class
*
* Possible Results:
* - process scheduling class is OS_SCHED_REALTIME
* - process scheduling class is OS_SCHED_TIMESHARE
* - process scheduling class is OS_SCHED_DEFAULT if
* the class effective could not be determined
*/
os_schedClass
os_procAttrGetClass(void)
{
os_schedClass class;
int policy;
policy = sched_getscheduler(getpid());
switch (policy)
{
case SCHED_FIFO:
case SCHED_RR:
class = OS_SCHED_REALTIME;
break;
case SCHED_OTHER:
class = OS_SCHED_TIMESHARE;
break;
case -1:
OS_REPORT_1(OS_WARNING, "os_procAttrGetClass", 1,
"sched_getscheduler failed with error %d", errno);
class = OS_SCHED_DEFAULT;
break;
default:
OS_REPORT_1(OS_WARNING, "os_procAttrGetClass", 1,
"sched_getscheduler unexpected return value %d", policy);
class = OS_SCHED_DEFAULT;
break;
}
return class;
}
示例6: cfgGetSchedule
static c_bool
cfgGetSchedule(
sr_serviceInfo si,
u_cfElement info)
{
c_iter iter;
int iterLength;
c_bool r;
u_cfData d;
c_char *str;
r = TRUE;
iter = u_cfElementXPath(info, "Scheduling/Class/#text");
iterLength = c_iterLength(iter);
d = u_cfData(c_iterTakeFirst(iter));
if (iterLength == 1) {
r = u_cfDataStringValue(d, &str);
if (r == TRUE) {
if (strncmp(str, SCHED_RT, strlen(SCHED_RT)) == 0) {
si->procAttr.schedClass = OS_SCHED_REALTIME;
} else {
if (strncmp(str, SCHED_TS, strlen(SCHED_TS)) == 0) {
si->procAttr.schedClass = OS_SCHED_TIMESHARE;
} else {
if (strcmp(str, SCHED_DEF)==0) {
si->procAttr.schedClass = OS_SCHED_DEFAULT;
} else {
si->procAttr.schedClass = OS_SCHED_DEFAULT;
OS_REPORT_1(OS_WARNING, OSRPT_CNTXT_SPLICED,
0, "Incorrect <Scheduling/Class> parameter for service %s -> default",
si->name);
r = TRUE;
}
}
}
os_free(str);
}
u_cfDataFree(d);
} else {
si->procAttr.schedClass = OS_SCHED_DEFAULT;
if (iterLength == 0) {
OS_REPORT_1(OS_INFO, OSRPT_CNTXT_SPLICED,
0, "Taking default for <Scheduling/Class> parameter service %s", si->name);
} else {
OS_REPORT_1(OS_ERROR, OSRPT_CNTXT_SPLICED,
0, "One <Scheduling/Class> parameter expected for service %s", si->name);
r = FALSE;
}
while (d != NULL) {
u_cfDataFree(d);
d = u_cfData(c_iterTakeFirst(iter));
}
}
c_iterFree(iter);
return r;
}
示例7: v_subscriberFree
void
v_subscriberFree(
v_subscriber s)
{
v_kernel kernel;
v_participant p;
v_reader o;
v_entity found;
c_long sc;
kernel = v_objectKernel(s);
sc = (c_long)pa_decrement(&(s->shareCount));
if (sc > 0) return;
if(sc == 0){
v_observableRemoveObserver(v_observable(kernel->groupSet),v_observer(s), NULL);
if (s->qos->share.enable) {
found = v_removeShare(kernel,v_entity(s));
assert(found == v_entity(s));
c_free(found);
}
while ((o = c_take(s->readers)) != NULL) {
switch (v_objectKind(o)) {
case K_DATAREADER:
v_dataReaderFree(v_dataReader(o));
break;
case K_DELIVERYSERVICE:
v_deliveryServiceFree(v_deliveryService(o));
break;
case K_GROUPQUEUE:
v_groupQueueFree(v_groupQueue(o));
break;
case K_NETWORKREADER:
v_networkReaderFree(v_networkReader(o));
break;
default:
OS_REPORT_1(OS_ERROR,
"v_subscriber", 0,
"Unknown reader %d",
v_objectKind(o));
assert(FALSE);
break;
}
c_free(o);
}
p = v_participant(s->participant);
if (p != NULL) {
v_participantRemove(p,v_entity(s));
s->participant = NULL;
}
v_publicFree(v_public(s));
} else {
OS_REPORT_1(OS_ERROR, "v_subscriberFree", 0,
"subscriber already freed (shareCount is now %d).", sc);
assert(sc == 0);
}
}
示例8: u_groupQueueNew
u_groupQueue
u_groupQueueNew(
u_subscriber s,
const c_char *name,
c_ulong queueSize,
v_readerQos qos)
{
u_participant p;
u_groupQueue _this = NULL;
v_subscriber ks = NULL;
v_groupQueue kn;
u_result result;
if (name != NULL) {
if (s != NULL) {
result = u_entityWriteClaim(u_entity(s),(v_entity*)(&ks));
if (result == U_RESULT_OK) {
assert(ks);
kn = v_groupQueueNew(ks,name,queueSize,qos);
if (kn != NULL) {
p = u_entityParticipant(u_entity(s));
_this = u_entityAlloc(p,u_groupQueue,kn,TRUE);
if (_this != NULL) {
result = u_groupQueueInit(_this,s);
if (result != U_RESULT_OK) {
OS_REPORT_1(OS_ERROR, "u_groupQueueNew", 0,
"Initialisation failed. "
"For groupQueue: <%s>.", name);
u_groupQueueFree(_this);
}
} else {
OS_REPORT_1(OS_ERROR, "u_groupQueueNew", 0,
"Create proxy failed. "
"For groupQueue: <%s>.", name);
}
c_free(kn);
} else {
OS_REPORT_1(OS_ERROR, "u_groupQueueNew", 0,
"Create kernel entity failed. "
"For groupQueue: <%s>.", name);
}
result = u_entityRelease(u_entity(s));
} else {
OS_REPORT_2(OS_WARNING, "u_groupQueueNew", 0,
"Claim Subscriber (0x%x) failed. "
"For groupQueue: <%s>.", s, name);
}
} else {
OS_REPORT_1(OS_ERROR,"u_groupQueueNew",0,
"No Subscriber specified. "
"For groupQueue: <%s>", name);
}
} else {
OS_REPORT(OS_ERROR,"u_groupQueueNew",0,
"No name specified.");
}
return _this;
}
示例9: u_cfDataSizeValueFromString
c_bool
u_cfDataSizeValueFromString(
c_char *str,
c_ulong *ul)
{
c_bool result;
c_char *temp;
c_char chp;
c_ulong base,res,retval = 0;
result = TRUE;
assert(str);
temp = os_malloc(strlen(str) +1);
if (temp != NULL) {
strcpy (temp,str);
retval = sscanf(temp, "%u%c",&res, &chp);
if (retval == 1) {
base =1;
} else if (retval == 2) {
switch(chp) {
case 'K':
base = 1024;
break;
case 'M':
base = pow(1024,2);
break;
case 'G':
base = pow(1024,3);
break;
default:
OS_REPORT_1(OS_ERROR, "u_cfDataSizeValueFromString", 0, "Invalid size specifier (%c)", chp);
base =1;
break;
}
} else {
OS_REPORT_1(OS_ERROR, "u_cfDataSizeValueFromString", 0, "Invalid size value (%s)", str);
res = 0;
base = 1;
}
/* boundary checking */
if (res > C_MAX_ULONG(L)/base) {
*ul = C_MAX_ULONG(L);
OS_REPORT_2(OS_WARNING, "u_cfDataSizeValueFromString", 0, "Configuration parameter value (%s) exceeds maximum size ulong, value changed to %lu",str,C_MAX_ULONG(L));
} else {
*ul = res*base;
}
os_free(temp);
} else {
result =0;
OS_REPORT_1(OS_ERROR, "u_cfDataSizeValueFromString", 0, "Malloc failed for configuration parameter value (%s)", str);
}
return result;
}
示例10: cfgGetPriorityKind
static c_bool
cfgGetPriorityKind(
sr_serviceInfo si,
u_cfElement info)
{
c_iter iter;
int iterLength;
c_bool r;
u_cfElement d;
c_char * str;
r = TRUE;
iter = u_cfElementXPath(info, "Scheduling/Priority");
iterLength = c_iterLength(iter);
d = u_cfElement(c_iterTakeFirst(iter));
if (iterLength == 1) {
r = u_cfElementAttributeStringValue(d, ATTR_PRIOKIND, &str);
if (r == TRUE) {
if (strcmp(str, PRIOKIND_REL) == 0) {
si->priorityKind = V_SCHED_PRIO_RELATIVE;
} else {
if (strcmp(str, PRIOKIND_ABS) == 0) {
si->priorityKind = V_SCHED_PRIO_ABSOLUTE;
} else {
si->priorityKind = V_SCHED_PRIO_RELATIVE;
OS_REPORT_1(OS_WARNING, OSRPT_CNTXT_SPLICED,
0, "Incorrect <Scheduling/Priority[@priority_kind]> attribute for service %s -> default",
si->name);
r = TRUE;
}
}
os_free(str);
}
u_cfElementFree(d);
} else {
if (iterLength == 0) {
si->priorityKind = V_SCHED_PRIO_RELATIVE;
OS_REPORT_1(OS_INFO, OSRPT_CNTXT_SPLICED,
0, "Taking default for <Scheduling/Priority[@priority_kind]> parameter for service %s", si->name);
} else {
OS_REPORT_1(OS_ERROR, OSRPT_CNTXT_SPLICED,
0, "One <Scheduling/Priority[@priority_kind]> parameter expected for service %s", si->name);
r = FALSE;
}
while (d != NULL) {
u_cfElementFree(d);
d = u_cfElement(c_iterTakeFirst(iter));
}
}
c_iterFree(iter);
return r;
}
示例11: u_partitionNew
u_partition
u_partitionNew(
u_participant p,
const c_char *name,
v_partitionQos qos)
{
u_partition _this = NULL;
v_kernel ke = NULL;
v_partition kd;
u_result result;
if (name == NULL) {
name = "No partition specified";
}
if (p != NULL) {
result = u_entityWriteClaim(u_entity(u_participantDomain(p)),(v_entity*)(&ke));
if ((result == U_RESULT_OK) && (ke != NULL)) {
kd = v_partitionNew(ke,name,qos);
if (kd != NULL) {
_this = u_entityAlloc(p,u_partition,kd,FALSE);
if (_this != NULL) {
result = u_partitionInit(_this);
if (result != U_RESULT_OK) {
OS_REPORT_1(OS_ERROR, "u_partitionNew", 0,
"Initialisation failed. "
"For Partition: <%s>.", name);
u_partitionFree(_this);
}
} else {
OS_REPORT_1(OS_ERROR, "u_partitionNew", 0,
"Create proxy failed. "
"For Partition: <%s>.", name);
}
c_free(kd);
} else {
OS_REPORT_1(OS_ERROR, "u_partitionNew", 0,
"Create kernel entity failed. "
"For Partition: <%s>", name);
}
result = u_entityRelease(u_entity(u_participantDomain(p)));
} else {
OS_REPORT_1(OS_WARNING, "u_partitionNew", 0,
"Claim Participant failed. "
"For Partition: <%s>", name);
}
} else {
OS_REPORT_1(OS_ERROR,"u_partitionNew",0,
"No Participant specified. "
"For Partition: <%s>", name);
}
return _this;
}
示例12: v_serviceChangeState
c_bool
v_serviceChangeState(
v_service service,
v_serviceStateKind newState)
{
c_bool result;
assert(service != NULL);
assert(C_TYPECHECK(service, v_service));
assert(service->state != NULL);
assert(C_TYPECHECK(service->state, v_serviceState));
result = v_serviceStateChangeState(service->state, newState);
if(result)
{
switch(newState)
{
case STATE_OPERATIONAL:
OS_REPORT_1(OS_INFO, "v_serviceChangeState", 0,
"++++++++++++++++++++++++++++++++++++++++++++++++" OS_REPORT_NL
"++ The service '%s' is now operational. " OS_REPORT_NL
"++++++++++++++++++++++++++++++++++++++++++++++++",
v_serviceGetName(service));
break;
case STATE_TERMINATED:
OS_REPORT_1(OS_INFO, "v_serviceChangeState", 0,
"================================================" OS_REPORT_NL
"== The service '%s' has now terminated. "OS_REPORT_NL
"================================================",
v_serviceGetName(service));
break;
case STATE_DIED:
OS_REPORT_1(OS_INFO, "v_serviceChangeState", 0,
"================================================" OS_REPORT_NL
"== The service '%s' has died. "OS_REPORT_NL
"================================================",
v_serviceGetName(service));
break;
case STATE_NONE:
case STATE_INITIALISING:
case STATE_TERMINATING:
case STATE_INCOMPATIBLE_CONFIGURATION:
default:
/* ignore */
break;
}
}
return result;
}
示例13: os_mmfDestroyHandle
void
os_mmfDestroyHandle (
os_mmfHandle mmfHandle)
{
OS_REPORT_1(OS_INFO, "os_mmfAttrInit", 0, "NOT IMPLEMENTED", NULL);
return;
}
示例14: v_entryResend
v_writeResult
v_entryResend(
v_entry e,
v_message o)
{
v_writeResult writeResult;
assert(C_TYPECHECK(e,v_entry));
assert(C_TYPECHECK(o,v_message));
switch(v_objectKind(e->reader)) {
case K_NETWORKREADER:
writeResult = V_WRITE_SUCCESS;
break;
case K_DATAREADER:
default:
OS_REPORT_1(OS_ERROR,
"v_entryWrite failed",0,
"illegal reader kind (%d) specified",
v_objectKind(e->reader));
assert(FALSE);
return V_WRITE_UNDEFINED;
}
return writeResult;
}
示例15: v_queryNotifyDataAvailable
c_bool
v_queryNotifyDataAvailable(
v_query _this,
v_event event)
{
c_bool result = TRUE;
switch (v_objectKind(_this)) {
case K_DATAREADERQUERY:
result = v_dataReaderQueryNotifyDataAvailable(
v_dataReaderQuery(_this),
event);
break;
case K_DATAVIEWQUERY:
result = v_dataViewQueryNotifyDataAvailable(
v_dataViewQuery(_this),
event);
break;
default:
break;
OS_REPORT_1(OS_ERROR,
"v_queryNotifyDataAvailable failed",0,
"illegal query kind (%d) specified",
v_objectKind(_this));
assert(FALSE);
result = TRUE;
}
return result;
}