fipa_acl  1.4
generator.cpp
Go to the documentation of this file.
1 
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <string>
14 #include <map>
15 #include <fipa_acl/message_generator/message_generator.h>
16 
17 std::map<std::string, std::string> options;
18 
19 bool usage(int argc, char** argv)
20 {
21  int option;
22 
23  if(argc <= 1)
24  {
25  printf("usage: %s -p <performative> -c <content>\n", argv[0]);
26  exit(0);
27  }
28 
29  while( (option = getopt(argc, argv, "hp:c:")) != -1 )
30  {
31  switch(option)
32  {
33 
34  case 'p':
35  options["performative"] = optarg;
36  break;
37  case 'c':
38  options["content"] = optarg;
39  break;
40  case 'h':
41  printf("usage: %s -p <performative> -c <content>\n", argv[0]);
42  exit(0);
43  default:
44  break;
45  }
46  }
47 
48  return true;
49 }
50 
51 int main(int argc, char** argv)
52 {
53  if( !usage(argc, argv) )
54  {
55  return 0;
56  }
57 
58  fipa::acl::ACLMessage msg(options["performative"]);
59  msg.setContent(options["content"]);
60 
62  int size = bitefficientMsg.size();
63 
64  for(int i = 0; i < size; i++)
65  {
66  fprintf(stderr, "%x ", bitefficientMsg[i]);
67  }
68 
69  fprintf(stderr, "\n");
70 
71 
72  return 0;
73 }
74 
75 
76 
77 
static std::string create(const ACLMessage &msg, const representation::Type &acl_representation)
int main(int argc, char **argv)
Definition: generator.cpp:51
void setContent(const std::string &content)
Definition: acl_message.h:274
std::map< std::string, std::string > options
Definition: generator.cpp:17
bool usage(int argc, char **argv)
Definition: generator.cpp:19
This class provides a representation of a message conforming to the FIPA specification SC00061...
Definition: acl_message.h:55