Cleanup
[jack2.git] / common / JackFifo.h
blobe91d212a1cb668d22b220d014f4b613f563c476c
1 /*
2 Copyright (C) 2004-2006 Grame
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __JackFifo__
21 #define __JackFifo__
23 #include "JackSynchro.h"
24 #include <assert.h>
25 #include <stdio.h>
26 #include <poll.h>
28 namespace Jack
31 /*!
32 \brief Inter process synchronization using Fifo.
35 class JackFifo : public JackSynchro
38 private:
40 int fFifo;
41 pollfd fPoll;
43 bool ConnectAux(const char* name, int access);
45 protected:
47 void BuildName(const char* name, char* res);
49 public:
51 JackFifo(): JackSynchro(), fFifo( -1)
53 virtual ~JackFifo()
56 bool Signal();
57 bool SignalAll();
58 bool Wait();
59 bool TimedWait(long usec);
61 bool Allocate(const char* name, int value);
62 bool Connect(const char* name);
63 bool ConnectInput(const char* name);
64 bool ConnectOutput(const char* name);
65 bool Disconnect();
66 void Destroy();
69 } // end of namespace
72 #endif