FACT++  1.0
int main ( int  argc,
char **  argv 
)

Definition at line 113 of file test_Browser.cxx.

References AllServices, AllServiceStates, dim_print_date_time(), DimBrowser::getNextService(), DimBrowser::getServices(), i, NBytes, NServices, and type.

114 {
115 
116  ErrorHandler errHandler;
117 // StrService servstr;
118  char *server, *ptr, *ptr1;
119  DimBrowser br;
120  int type, n, index, i, ret;
121  MyTimer *myTimer;
122  char findStr[132];
123 
124  ret = 0;
125  strcpy(findStr,"*");
126  if(argc > 1)
127  {
128  if(!strcmp(argv[1],"-f"))
129  {
130  if(argc > 2)
131  strcpy(findStr,argv[2]);
132  else
133  ret = 1;
134  }
135  else
136  ret = 1;
137  if(ret)
138  {
139  printf("Parameters: [-f <search string>]\n");
140  exit(0);
141  }
142  }
143 // DimClient::addErrorHandler(errHandler);
145 printf("Asking %s\n", findStr);
146  n = br.getServices(findStr);
148  cout << "found " << n << " services" << endl;
149 
150  AllServices = (void **) new TestGetService*[n];
151  AllServiceStates = new int[n];
152  NServices = n;
153  NBytes = 0;
154  index = 0;
155  for(i = 0; i < n; i++)
156  AllServiceStates[i] = 0;
157  while((type = br.getNextService(ptr, ptr1))!= 0)
158  {
159 
160  // cout << "type = " << type << " - " << ptr << " " << ptr1 << endl;
161  AllServiceStates[index] = -2;
162  AllServices[index] = new TestGetService(ptr);
163  index++;
164  // if(index >= 1000)
165  // break;
166  }
167  myTimer = new MyTimer();
169  printf("Got Service Names\n");
170  /*
171  br.getServers();
172  while(br.getNextServer(server, ptr1))
173  {
174  cout << server << " @ " << ptr1 << endl;
175  }
176 
177  br.getServerClients("DIS_DNS");
178  while(br.getNextServerClient(ptr, ptr1))
179  {
180  cout << ptr << " @ " << ptr1 << endl;
181  }
182  DimInfo servint("TEST/INTVAL",-1);
183  */
184  while(1)
185  {
186  sleep(10);
187  /*
188  cout << "Current INTVAL : " << servint.getInt() << endl;
189  DimClient::sendCommand("TEST/CMND","UPDATE_STRVAL");
190  */
191  }
192  return 0;
193 }
int i
Definition: db_dim_client.c:21
int getServices(const char *serviceName)
Definition: diccpp.cxx:849
int NBytes
int type
int NServices
int * AllServiceStates
void ** AllServices
void dim_print_date_time()
Definition: utilities.c:134
int getNextService(char *&service, char *&format)
Definition: diccpp.cxx:948

+ Here is the call graph for this function: