摘要: typedef union 定义联合体.typedef struct 定义结构体.联合体可以由不同类型的简单变量组合构成.结构体可以由不同类型的较复杂的变量组合构成.结构体里可以含联合体.联合体里不能含结构体. 阅读全文
posted @ 2011-10-20 23:12 greencolor 阅读(2212) 评论(0) 推荐(0) 编辑
摘要: readOneSectionFromDumpfile(fopen( filename, "r" ))static int readOneSectionFromDumpfile( FILE* dumpFile ){ memset( dumpFileSection, 0, sizeof(dumpFileSection) ); numLineForSection = 0; while (1) { if (feof( dumpFile ) || ferror( dumpFile )) { break; } char *pLine = dumpFileSection[numLineF 阅读全文
posted @ 2011-10-20 22:47 greencolor 阅读(135) 评论(0) 推荐(0) 编辑
摘要: char * fgets ( char * str, int num, FILE * stream );Get string from streamReads characters from stream and stores them as a C string into str until (num-1) characters have been read or either a newline or a the End-of-File is reached, whichever comes first.A newline character makes fgets stop readin 阅读全文
posted @ 2011-10-20 22:05 greencolor 阅读(209) 评论(0) 推荐(0) 编辑
摘要: typedef union{stepper_motor_tstepper;pseudo_motor_tpseudo;motor_tmotor;ion_chamber_tion;shutter_tshutter;hardware_host_thardware;run_values_trunvalues;runs_status_truns;operation_t operation;encoder_t encoder;string_t string;object_t object;generic_device_tgeneric;dummy_device_tdummy;} beamline_dev. 阅读全文
posted @ 2011-10-20 20:22 greencolor 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <utility>#include <string>using namespace std;int main () { pair <string,double> product1 ("tomatoes",3.25); pair <string,double> product2; pair <string,double> product3; product2.first = "lightbulbs"; // type of fir 阅读全文
posted @ 2011-10-20 15:27 greencolor 阅读(142) 评论(0) 推荐(0) 编辑
摘要: DcsConfig gDcssConfig\\XosConfig config;XosConfig defConfig;\\#ifndef __Include_XosConfig_h__#define __Include_XosConfig_h__#include "xos.h"#include <string>#include <map>#include <list>typedef std::list<std::string> StrList;typedef std::multimap<std::string, std 阅读全文
posted @ 2011-10-20 14:52 greencolor 阅读(121) 评论(0) 推荐(0) 编辑
摘要: class DcsConfig#ifndef __Include_DcsConfig_h__#define __Include_DcsConfig_h__#include "XosConfig.h"#include <string>class DcsConfig{public:DcsConfig();DcsConfig(const std::string& dcs_dir, const std::string& config_root);virtual ~DcsConfig();void setConfigDir(const std::strin 阅读全文
posted @ 2011-10-20 14:46 greencolor 阅读(151) 评论(0) 推荐(0) 编辑
摘要: typedef unsigned long xos_hash_data_t;typedef struct {char*key;xos_hash_data_t data;} xos_hash_entry_t;typedef unsigned int xos_size_t;typedef struct {xos_size_tslotCount;xos_size_tusedSlots;xos_hash_entry_t *slot;xos_boolean_t isValid;} xos_hash_t;struct __log_manager {xos_hash_t loggers;};struct _ 阅读全文
posted @ 2011-10-20 12:55 greencolor 阅读(185) 评论(0) 推荐(0) 编辑