当前位置: 首页>>代码示例>>C++>>正文


C++ Sink::FlushSink方法代码示例

本文整理汇总了C++中Sink::FlushSink方法的典型用法代码示例。如果您正苦于以下问题:C++ Sink::FlushSink方法的具体用法?C++ Sink::FlushSink怎么用?C++ Sink::FlushSink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sink的用法示例。


在下文中一共展示了Sink::FlushSink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
				scanf( "%s", buffer1 );
				if( !collection.RemoveClassAd( buffer1 ) ) {
					fprintf( stderr, "Failed to remove classad %s\n", buffer1 );
					fprintf( stderr, "%s\n", CondorErrMsg.c_str( ) );
					CondorErrMsg = "";
				}
				break;
			}


				// display
			case VIEW_CONTENT: {
				scanf( "%s", buffer1 );
				if( !collection.DisplayView( buffer1, stdout ) ) {
					fprintf( stderr, "Failed to display view %s\n", buffer1 );
				}
				break;
			}

				// view control
			case CREATE_SUBVIEW: {
				char	constraint[2048], rank[2048], partitionExprs[2048];
				scanf( "%s %s %s %s %s", buffer1, buffer2, constraint, rank, 
					partitionExprs );
				if( !collection.CreateSubView( buffer1, buffer2, constraint, 
						rank, partitionExprs ) ) {
					fprintf( stderr, "Failed to create subview with:\n"
						"ViewName=%s, ParentViewName=%s, Constraint=%s, "
						"Rank=%s, PartitionExprs=%s\n", buffer1, buffer2, 
						constraint, rank, partitionExprs );
					fprintf( stderr, "%s\n", CondorErrMsg.c_str( ) );
					CondorErrMsg = "";
				}
				break;
			}
				
			case CREATE_PARVIEW: {
				ClassAd	*ad=NULL;
				char constraint[2048],rank[2048],partitionExprs[2048],rep[2048];

				scanf( "%s %s %s %s %s %s", buffer1, buffer2, constraint, rank, 
					partitionExprs, rep );

				if( !src.SetSource( rep ) || !src.ParseClassAd( ad ) ) {
					fprintf( stderr, "Failed to parse classad: %s\n", rep );
					break;
				}

				if( !collection.CreatePartition( buffer1, buffer2, constraint, 
						rank, partitionExprs, ad ) ) {
					fprintf( stderr, "Failed to create partition with:\n"
						"ViewName=%s, ParentViewName=%s, Constraint=%s, "
						"Rank=%s, PartitionExprs=%s, Rep=%s\n",buffer1,buffer2, 
						constraint, rank, partitionExprs, rep );
					fprintf( stderr, "%s\n", CondorErrMsg.c_str( ) );
					CondorErrMsg = "";
				}
				break;
			}

			case DELETE_VIEW: {
				scanf( "%s", buffer1 );
				if( !collection.DeleteView( buffer1 ) ) {
					fprintf( stderr, "Failed to delete view: %s\n" , buffer1 );
					fprintf( stderr, "%s\n", CondorErrMsg.c_str( ) );
					CondorErrMsg = "";
				}
				break;
			}

			case SHOW_CLASSAD: {
				ClassAd	*ad;
				scanf( "%s", buffer1 );
				if( !( ad = collection.GetClassAd( buffer1 ) ) ) {
					fprintf( stderr, "Failed to get classad %s\n", buffer1 );
					fprintf( stderr, "%s\n", CondorErrMsg.c_str( ) );
					CondorErrMsg = "";
					break;
				}
				ad->ToSink( snk );
				snk.FlushSink( );
				break;
			}

				// misc
			case SACRED:
			case HELP:
				help( );
				break;

			case QUIT:
				printf( "Done\n" );
				exit( 0 );

			default:
				break;
		}
		fgets( buffer1, 2048, stdin );
	}	
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:101,代码来源:testcoll.cpp


注:本文中的Sink::FlushSink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。