fipa_acl  1.4
Functions | Variables
generator.cpp File Reference

Console program that asks for settings of the fipa message and output the corresponding bytestream of a bitefficient message. More...

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string>
#include <map>
#include <fipa_acl/message_generator/message_generator.h>

Go to the source code of this file.

Functions

bool usage (int argc, char **argv)
 
int main (int argc, char **argv)
 

Variables

std::map< std::string, std::string > options
 

Detailed Description

Console program that asks for settings of the fipa message and output the corresponding bytestream of a bitefficient message.

Author
Thomas Roehr, thoma.nosp@m.s.ro.nosp@m.ehr@d.nosp@m.fki..nosp@m.de

Definition in file generator.cpp.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 51 of file generator.cpp.

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 }
static std::string create(const ACLMessage &msg, const representation::Type &acl_representation)
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
bool usage ( int  argc,
char **  argv 
)

Definition at line 19 of file generator.cpp.

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 }
std::map< std::string, std::string > options
Definition: generator.cpp:17

Variable Documentation

std::map<std::string, std::string> options

Definition at line 17 of file generator.cpp.