本文整理汇总了C++中CHECK_RC函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_RC函数的具体用法?C++ CHECK_RC怎么用?C++ CHECK_RC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECK_RC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CHECK_RC
/**
* @param fileName 要发送的文件路径.
* @return 结果代码.
*
* 将模型文件发送至服务器.
* 接收服务器返回的结果.
* 当中任何一个步骤出现错误则直接返回对应的结果代码,
* 全部成功返回OK.
*/
RC Client::SendModelFile(LPCWSTR fileName)
{
RC rc;
CHECK_RC(m_Socket.SendCommand(CC::SEND_MODEL_FILE_COMMAND));
RC _rc = m_Socket.SendFile(fileName);
if (OK == _rc)
{
CHECK_RC(m_Socket.RecvRC(_rc));
if (OK == _rc)
{
wstring datFileName = fileName;
datFileName += TEXT(".dat");
CHECK_RC(m_Socket.RecvFile(datFileName.c_str()));
}
}
return _rc;
}
开发者ID:chinarustin,项目名称:aep,代码行数:29,代码来源:client.cpp
示例2: configKinect
int configKinect(){
XnStatus rc = XN_STATUS_OK;
xn::EnumerationErrors errors;
// Initialize OpenNI
rc = g_Context.InitFromXmlFile(SAMPLE_XML_PATH, g_ScriptNode, &errors);
CHECK_ERRORS(rc, errors, "InitFromXmlFile");
CHECK_RC(rc, "InitFromXmlFile");
rc = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
CHECK_RC(rc, "Find depth generator");
rc = g_Context.FindExistingNode(XN_NODE_TYPE_GESTURE, g_GestureGenerator);
CHECK_RC(rc, "Find gesture generator");
XnCallbackHandle hGestureIntermediateStageCompleted, hGestureProgress, hGestureReadyForNextIntermediateStage;
g_GestureGenerator.RegisterToGestureIntermediateStageCompleted(GestureIntermediateStageCompletedHandler, NULL, hGestureIntermediateStageCompleted);
g_GestureGenerator.RegisterToGestureReadyForNextIntermediateStage(GestureReadyForNextIntermediateStageHandler, NULL, hGestureReadyForNextIntermediateStage);
g_GestureGenerator.RegisterGestureCallbacks(NULL, GestureProgressHandler, NULL, hGestureProgress);
// Create NITE objects
g_pSessionManager = new XnVSessionManager;
rc = g_pSessionManager->Initialize(&g_Context, "Click,Wave", "RaiseHand");
CHECK_RC(rc, "SessionManager::Initialize");
g_pSessionManager->RegisterSession(NULL, SessionStarting, SessionEnding, FocusProgress);
pointHandler = new PointHandler(20, g_DepthGenerator);
g_pFlowRouter = new XnVFlowRouter;
g_pFlowRouter->SetActive(pointHandler);
g_pSessionManager->AddListener(g_pFlowRouter);
pointHandler->RegisterNoPoints(NULL, NoHands);
// Initialization done. Start generating
rc = g_Context.StartGeneratingAll();
CHECK_RC(rc, "StartGenerating");
return rc;
}
开发者ID:cphoward,项目名称:AquaKinect,代码行数:41,代码来源:main.cpp
示例3: init_mc
int init_mc(struct ctx *p_ctx, res_hndl_t *res_hndl)
{
int rc;
__u64 chunks=16;
__u64 actual_size=0;
rc = mc_init();
CHECK_RC(rc, "mc_init failed");
debug("mc_init success :%d\n",rc);
rc = ctx_init(p_ctx);
CHECK_RC(rc, "Context init failed");
rc = create_res(p_ctx);
CHECK_RC(rc, "opening res_hndl");
rc = mc_size1(p_ctx,chunks, &actual_size);
CHECK_RC(rc, "mc_size");
*res_hndl = p_ctx->res_hndl;
rc = create_res(p_ctx);
CHECK_RC(rc, "opening res_hndl");
rc = mc_size1(p_ctx, chunks, &actual_size);
CHECK_RC(rc, "mc_size");
return 0;
}
开发者ID:bedrisendir,项目名称:capiflash,代码行数:28,代码来源:cflash_test_error.c
示例4: create_ctx_process
int create_ctx_process(char *dev, dev64_t devno, __u64 chunk)
{
int rc;
struct ctx my_ctx;
struct ctx *p_ctx = &my_ctx;
g_error=0;
pid = getpid();
pthread_t threads[MAX_RES_HANDLE];
pthread_t intr_thread;
//__u64 flags;
int i;
rc = ctx_init2(p_ctx, dev, DK_AF_ASSIGN_AFU, devno);
CHECK_RC(rc, "Context init failed");
// interrupt handler per context
rc = pthread_create(&intr_thread, NULL, ctx_rrq_rx, p_ctx);
p_ctx ->lun_size = chunk * p_ctx->chunk_size;
for (i = 0; i <MAX_RES_HANDLE; i++)
{
if ( MAX_RES_HANDLE == i+1 && imLastContext == 1 )
{ // this is last resource of last context
debug("%d:create_ctx_process: last res ==> %d of last contxt \n", pid,i+1);
p_ctx ->lun_size = ( chunk + chunkRemain )*p_ctx->chunk_size;
}
rc = pthread_create(&threads[i], NULL, res_thread, p_ctx);
CHECK_RC(rc, "pthread_create failed");
}
//wait all threads to get complete
for (i = 0; i <MAX_RES_HANDLE; i++)
{
pthread_join(threads[i], NULL);
}
pthread_cancel(intr_thread);
rc = g_error;
g_error = 0;
return rc;
}
开发者ID:bedrisendir,项目名称:capiflash,代码行数:40,代码来源:cflash_test_ioctl_io.c
示例5: CHECK_RC
/*private*/ inline void UserManager::broadcastJointPositions(XnUserID currentUserId, XnSkeletonJoint jointEnum, int jointId) {
XnSkeletonJointPosition jointPosition;
// TODO strange, this is how it should be ... :-/
// this->skeletonCapability.GetSkeletonJointPosition(currentUserId, jointEnum, jointPosition);
CHECK_RC(this->skeletonCapability.GetSkeletonJointPosition(currentUserId, jointEnum, jointPosition), "Get joint position failed");
if(jointPosition.fConfidence < 0.5) { return; }
for(int i=0, n = this->listeners.size(); i < n; i++) {
this->listeners.at(i)->onJointPositionChanged(currentUserId, jointId, jointPosition);
}
}
开发者ID:christophpickl,项目名称:ponyo-svn,代码行数:13,代码来源:UserManager.cpp
示例6: get_peerProfileById
bool get_peerProfileById(const char *uid, char **nick_name, char **group_name, int *sex, int *age, char **introduction, char **head_image_path, int *server_id, char **server_uid, char **last_ip, int *tcp_port, int *udp_port)
{
int nrows,ncols; //nrows:记录返回数据库表的行数,ncols:记录返回表的列数
char *errmsg=0;//记录返回的错误信息。
char **results;//记录返回的查询结果
sqlite3 *db=0; //记录返回的数据库句柄
if(!open_db(&db, PEERSINFO_DBFILE_NAME))
return false;
//下述函数进行查询数据库操作
char *szBaseSql = "select * from peers_profile where uid='";
char *szSql = v6strcat(3, szBaseSql, uid, "';");
int rc=sqlite3_get_table(db,szSql,&results,&nrows,&ncols,&errmsg);
release_db_data((void **)&szSql);
CHECK_RC(rc,errmsg,db);
bool success = true;
if(nrows > 0)
{
int buf_size = strlen(results[PEERSINFO_DB_ROWS+1])+1;
*nick_name = (char*)malloc(buf_size);
memcpy(*nick_name, results[PEERSINFO_DB_ROWS+1], buf_size);
buf_size = strlen(results[PEERSINFO_DB_ROWS+2])+1;
*group_name = (char*)malloc(buf_size);
memcpy(*group_name, results[PEERSINFO_DB_ROWS+2], buf_size);
*sex = atoi(results[PEERSINFO_DB_ROWS+3]);
*age = atoi(results[PEERSINFO_DB_ROWS+4]);
buf_size = strlen(results[PEERSINFO_DB_ROWS+5])+1;
*introduction = (char*)malloc(buf_size);
memcpy(*introduction, results[PEERSINFO_DB_ROWS+5], buf_size);
buf_size = strlen(results[PEERSINFO_DB_ROWS+6])+1;
*head_image_path = (char*)malloc(buf_size);
memcpy(*head_image_path, results[PEERSINFO_DB_ROWS+6], buf_size);
*server_id = atoi(results[PEERSINFO_DB_ROWS+7]);
buf_size = strlen(results[PEERSINFO_DB_ROWS+8])+1;
*server_uid = (char*)malloc(buf_size);
memcpy(*server_uid, results[PEERSINFO_DB_ROWS+8], buf_size);
buf_size = strlen(results[PEERSINFO_DB_ROWS+9])+1;
*last_ip = (char*)malloc(buf_size);
memcpy(*last_ip, results[PEERSINFO_DB_ROWS+9], buf_size);
*tcp_port = atoi(results[PEERSINFO_DB_ROWS+10]);
*udp_port = atoi(results[PEERSINFO_DB_ROWS+11]);
}
else
success = false;
sqlite3_free_table(results);
sqlite3_close(db);
return success;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:51,代码来源:db_interface.cpp
示例7: test_spio_direct_virtual
int test_spio_direct_virtual()
{
int rc=0;
int j;
int cfdisk = 0;
struct flash_disk fldisks[MAX_FDISK];
//__u64 chunk;
int count = 1;
int procces=10;
int index = 0; //to switch flash disks for VLUN & PLUN IO
char *str = getenv("LONG_RUN");
if (str != NULL)
{
printf("LONG_RUN enabled...\n");
count = 10;
}
cfdisk = get_flash_disks(fldisks, FDISKS_ALL);
if (cfdisk < 2)
{
fprintf(stderr,"Must have 2 flash disks..\n");
return -1;
}
while (count-- >0)
{
if (0 == fork())
{
rc = test_spio_lun(fldisks[index].dev,
fldisks[index].devno[0],LUN_DIRECT,0);
exit(rc);
}
//create atleast 10 chunks on each on PLUN
index = (index+1)%2;
for (j=0; j < procces; j++)
{
if (0 == fork()) //child process
{
//here you can change the path ids later
rc = test_spio_lun(fldisks[index].dev, fldisks[index].devno[0],
LUN_VIRTUAL,chunks[j]);
exit(rc);
}
}
rc = wait4all();
CHECK_RC(rc, "wait4all failed");
printf("%d loop remain................\n",count);
}
return rc;
}
开发者ID:bedrisendir,项目名称:capiflash,代码行数:50,代码来源:cflash_test_ioctl_io.c
示例8: test_cfdisk_ctxs_diff_devno
// 7.1.217 : create two context for same flash disks shared between 2 adapters
int test_cfdisk_ctxs_diff_devno()
{
int nDisk;
int rc=0;
struct flash_disk cfDisk[2];
struct ctx myctx1, myctx2;
struct ctx *p_ctx1 = &myctx1;
struct ctx *p_ctx2 = &myctx2;
pid = getpid();
nDisk = get_flash_disks(cfDisk, FDISKS_DIFF_ADPTR);
if (nDisk < 2)
{
fprintf(stderr,"Failed to find 2 flash disks from diff adapter..\n");
return -1;
}
// On AIX both dev will have same name
// On Linux both dev will have diff name
rc = ctx_init2(p_ctx1, cfDisk[0].dev, DK_AF_ASSIGN_AFU, cfDisk[0].devno[0]);
CHECK_RC(rc, "p_ctx1 Context init failed");
rc = ctx_init2(p_ctx2, cfDisk[1].dev, DK_AF_ASSIGN_AFU, cfDisk[1].devno[0]);
CHECK_RC(rc, "p_ctx2 Context init failed");
rc = create_resource(p_ctx1, 0, DK_UDF_ASSIGN_PATH, LUN_DIRECT);
CHECK_RC(rc, "create LUN_DIRECT for p_ctx1 failed");
rc = create_resource(p_ctx2, 0, DK_UDF_ASSIGN_PATH, LUN_DIRECT);
CHECK_RC(rc, "create LUN_DIRECT for p_ctx2 failed");
cleanup(p_ctx1, -1);
cleanup(p_ctx2, -1);
return 0;
}
开发者ID:ychtiger,项目名称:capiflash,代码行数:38,代码来源:cflash_test_error2.c
示例9: getDepthGenerator
bool ofxOpenNIContext::unregisterViewport() {
// get refs to depth generator
xn::DepthGenerator depth_generator;
getDepthGenerator(&depth_generator);
// Unregister view point from (image) any map
if (depth_generator.IsCapabilitySupported(XN_CAPABILITY_ALTERNATIVE_VIEW_POINT)) {
XnStatus result = depth_generator.GetAlternativeViewPointCap().ResetViewPoint();
CHECK_RC(result, "Unregister viewport");
} else return false;
return true;
}
开发者ID:wearenocomputer,项目名称:ofxOpenNI_NC,代码行数:15,代码来源:ofxOpenNIContext.cpp
示例10: CHECK_RC
// Barebones setup
bool CinderOpenNISkeleton::setup()
{
XnStatus nRetVal = XN_STATUS_OK;
xn::EnumerationErrors errors;
// Init
nRetVal = mContext.Init();
CHECK_RC(nRetVal, "Init", true);
nRetVal = xnFPSInit(&xnFPS, 180);
CHECK_RC(nRetVal, "FPS Init", true);
worldOffset.x = -160;
worldOffset.y = -200;
worldOffset.z = -2784;
// Output device production nodes (user, depth, etc)
debugOutputNodeTypes();
_allUsers.clear();
for(int i = 0; i < maxUsers; i++) {
UserSkeleton emptySkeleton;
emptySkeleton.isValid = false;
emptySkeleton.id = currentUsers[i];
// Create a bunch of spots to contain our vectors
emptySkeleton.projectedPositions.clear();
for( int j = 0; j <= XN_SKEL_RIGHT_FOOT+1; ++j) {
emptySkeleton.projectedPositions.push_back( ci::Vec3f::zero() );
}
_allUsers.push_back( emptySkeleton );
}
return true;
}
开发者ID:onedayitwillmake,项目名称:QuadDistrust,代码行数:37,代码来源:CinderOpenNI.cpp
示例11: max_vlun_on_a_ctx
int max_vlun_on_a_ctx()
{
int i;
int rc;
struct ctx myctx;
struct ctx *p_ctx=&myctx;
pid = getpid();
rc=ctx_init(p_ctx);
__u64 vluns[MAX_VLUNS];
for (i=0;i<MAX_VLUNS;i++)
{
rc = create_resource(p_ctx,p_ctx->chunk_size,0,LUN_VIRTUAL);
CHECK_RC(rc, "create_resource Failed\n");
vluns[i]=p_ctx->rsrc_handle;
}
for (i=0;i<MAX_VLUNS;i++)
{
p_ctx->rsrc_handle=vluns[i];
rc=close_res(p_ctx);
CHECK_RC(rc, "close_res failed\n");
}
rc = ctx_close(p_ctx);
return rc;
}
开发者ID:bedrisendir,项目名称:capiflash,代码行数:24,代码来源:cflash_test_ioctl_io.c
示例12: CHECK_RC
RC AlgorithmDataFile::RemoveAlgorithm(wstring name)
{
RC rc;
if (m_Lines.find(name) == m_Lines.end())
{
return RC::ALGORITHM_REMOVE_ERROR;
}
m_Lines.erase(name);
CHECK_RC(Save());
return rc;
}
开发者ID:chinarustin,项目名称:aep,代码行数:15,代码来源:algorithm_data_file.cpp
示例13: clear_peersProfile
bool clear_peersProfile()
{
char *errmsg=0;//记录返回的错误信息。
sqlite3 *db=0; //记录返回的数据库句柄
if(!open_db(&db, PEERSINFO_DBFILE_NAME))
return false;
//下述函数进行数据库添加操作
char *szSql = "delete from peers_profile";
int rc=sqlite3_exec(db,szSql,0,0,&errmsg);
CHECK_RC(rc,errmsg,db);
sqlite3_close(db);
return true;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:16,代码来源:db_interface.cpp
示例14: delete_peerProfile
bool delete_peerProfile(const char *uid)
{
char *errmsg=0;//记录返回的错误信息。
sqlite3 *db=0; //记录返回的数据库句柄
if(!open_db(&db, PEERSINFO_DBFILE_NAME))
return false;
//下述函数进行数据库添加操作
char *szSql = v6strcat(2, "delete from peers_profile where uid = ", uid);
int rc=sqlite3_exec(db,szSql,0,0,&errmsg);
CHECK_RC(rc,errmsg,db);
sqlite3_close(db);
return true;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:16,代码来源:db_interface.cpp
示例15: clear_serversInformation
bool clear_serversInformation()
{
char *errmsg=0;//记录返回的错误信息。
sqlite3 *db=0; //记录返回的数据库句柄
if(!open_db(&db, SERVERSINFO_DBFILE_NAME))
return false;
//下述函数进行数据库添加操作
char *szSql = "delete * from server_information";
int rc=sqlite3_exec(db,szSql,0,0,&errmsg);
CHECK_RC(rc,errmsg,db);
sqlite3_close(db);
return true;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:16,代码来源:db_interface.cpp
示例16: CHECK_RC
void OpenNiManager::startAll() {
LOG->info("startAll()");
for(int i = 0, n = this->cams.size(); i < n; i++) {
Cam* currentCam = cams.at(i);
std::cout << (i+1) << ". " << currentCam->toString() << std::endl;
if(this->initDescriptor->isImageGeneratorRequired()) {
xn::ImageGenerator generator = currentCam->getImageGenerator();
CHECK_RC(generator.StartGenerating(), "generator.StartGenerating()");
}
if(this->initDescriptor->isUserGeneratorRequired()) {
this->userManager->start();
}
}
}
开发者ID:christophpickl,项目名称:ponyo-svn,代码行数:17,代码来源:OpenNiManager.cpp
示例17: CHECK_RC
bool ofxDepthGenerator::setup(ofxOpenNIContext* pContext) {
XnStatus result = XN_STATUS_OK;
XnMapOutputMode map_mode;
// Try to fetch depth generator before creating one
if(pContext->getDepthGenerator(&depth_generator)) {
// found the depth generator so set map_mode from it
depth_generator.GetMapOutputMode(map_mode);
} else {
result = depth_generator.Create(pContext->getXnContext());
CHECK_RC(result, "Creating depth generator");
if (result != XN_STATUS_OK) return false;
// make new map mode -> default to 640 x 480 @ 30fps
map_mode.nXRes = XN_VGA_X_RES;
map_mode.nYRes = XN_VGA_Y_RES;
map_mode.nFPS = 30;
depth_generator.SetMapOutputMode(map_mode);
}
// Default max depth is on GlobalDefaults.ini: MaxDepthValue=10000
max_depth = depth_generator.GetDeviceMaxDepth();
width = map_mode.nXRes;
height = map_mode.nYRes;
// TODO: add capability for b+w depth maps (more efficient for draw)
depth_texture.allocate(map_mode.nXRes, map_mode.nYRes, GL_RGBA);
depth_pixels = new unsigned char[map_mode.nXRes * map_mode.nYRes * 4];
memset(depth_pixels, 0, map_mode.nXRes * map_mode.nYRes * 4 * sizeof(unsigned char));
// setup mask pixelskk
for (int i = 0; i < MAX_NUMBER_DEPTHS; i++) {
maskPixels[i] = new unsigned char[width * height];
depth_thresholds[i].nearThreshold = 0;
depth_thresholds[i].farThreshold = 10000;
}
depth_generator.StartGenerating();
printf("Depth camera inited\n");
return true;
}
开发者ID:nariakiiwatani,项目名称:perfume-training-gypsum,代码行数:46,代码来源:ofxDepthGenerator.cpp
示例18: sizeof
std::vector<std::vector<XnPoint3D> > KinectControl::getSkeleton()
{
SkeletonCapability skeleton = user_generator.GetSkeletonCap();
XnUserID user_id[15];
XnUInt16 user_count = sizeof(user_id) / sizeof(user_id[0]);
XnStatus nRetVal = user_generator.GetUsers(user_id, user_count);
CHECK_RC(nRetVal, "Get Users");
// 全ユーザ
std::vector<std::vector<XnPoint3D> > skeletons;
for(int i = 0; i < user_count; ++i)
{
// i番目のユーザがトラッキングされていたら
if(skeleton.IsTracking(user_id[i]))
{
// 個別ユーザ
std::vector<XnPoint3D> user_skeleton;
// 関節は全てで24個
XnSkeletonJointPosition joint[24];
// [0]はCenter of Mass
XnPoint3D pt[25];
for(int j = 1; j < 25; ++j)
{
skeleton.GetSkeletonJointPosition(user_id[i], (XnSkeletonJoint)(j), joint[j - 1]);
pt[j] = joint[j - 1].position;
}
user_generator.GetCoM(user_id[i], pt[0]);
depth_generator.ConvertRealWorldToProjective(25, pt, pt);
for(int j = 0; j < 25; ++j)
user_skeleton.push_back(pt[j]);
skeletons.push_back(user_skeleton);
}
}
return skeletons;
}
开发者ID:mitmul,项目名称:HappyMap,代码行数:45,代码来源:KinectControl.cpp
示例19: ofAddListener
//--------------------------------------------------------------
bool ofxHandGenerator::setup(ofxOpenNIContext* pContext) {
context = pContext;
context->getDepthGenerator(&depth_generator);
XnStatus result = XN_STATUS_OK;
// setup a gesture generator using our ofxGestureGenerator wrapper
gesture_generator.setup(context);
ofAddListener(gesture_generator.gestureRecognized, this, &ofxHandGenerator::gestureRecognized);
// Try to fetch hands generator before creating one
if(pContext->getHandsGenerator(&hands_generator)) {
// found the hands generator - for do nothing
} else {
result = hands_generator.Create(context->getXnContext());
CHECK_RC(result, "Creating hand generator");
hands_generator.StartGenerating();
}
XnCallbackHandle hand_cb_handle;
hands_generator.RegisterHandCallbacks(HandCreate, HandUpdate, HandDestroy, this, hand_cb_handle);
printf("Hands generator inited\n");
// pre-generate the tracked users.
tracked_hands.reserve(max_hands);
for(int i = 0; i < max_hands; ++i) {
printf("Creating hand: %d", i);
ofxTrackedHand* hand = new ofxTrackedHand(context);
tracked_hands.push_back(hand);
}
found_hands = 0;
isFiltering = false;
// Start looking for gestures
this->addGestures();
return true;
}
开发者ID:LukeAtherton,项目名称:the_room,代码行数:43,代码来源:ofxHandGenerator.cpp
示例20: get_peersProfile
bool get_peersProfile(char ***peers_table, int *rows, int *cols)
{
char *errmsg=0;//记录返回的错误信息。
sqlite3 *db=0; //记录返回的数据库句柄
if(!open_db(&db, PEERSINFO_DBFILE_NAME))
return false;
//下述函数进行查询数据库操作
char *szSql = "select * from peers_profile";
int rc=sqlite3_get_table(db,szSql,peers_table,rows,cols,&errmsg);
CHECK_RC(rc,errmsg,db);
bool success = true;
if(SQLITE_OK != errmsg)
success = false;
sqlite3_close(db);
return success;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:20,代码来源:db_interface.cpp
注:本文中的CHECK_RC函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论