InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IbGateway.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Mark Travis <mtravis15432+src@gmail.com>
3  * All rights reserved. No warranty, explicit or implicit, provided.
4  *
5  * This file is part of InfiniSQL(tm).
6 
7  * InfiniSQL is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 3
9  * as published by the Free Software Foundation.
10  *
11  * InfiniSQL is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with InfiniSQL. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
30 #ifndef INFINISQLIBGATEWAY_H
31 #define INFINISQLIBGATEWAY_H
32 
33 #include "gch.h"
34 
38 class IbGateway
39 {
40 public:
49  IbGateway(Topology::partitionAddress *myIdentityArg);
50  virtual ~IbGateway();
51 
53  class Mboxes mboxes;
55 
56 private:
63  void inbufhandler(const char *buf, size_t bufsize);
69  void addtofds(int newfd);
74  void removefds();
75 
76  boost::unordered_map<int, std::string> pendingReads;
77  boost::unordered_set<int> fdremoveset;
78  struct pollfd *fds;
79  nfds_t nfds;
80  char *inbuf;
81  char *dcstrsmall;
83 };
84 
92 void *ibGateway(void *identity);
93 
94 #endif /* INFINISQLIBGATEWAY_H */