JackMachServerChannel.h

00001 /*
00002 Copyright (C) 2004-2008 Grame  
00003 
00004 This program is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details.
00013 
00014   You should have received a copy of the GNU General Public License
00015   along with this program; if not, write to the Free Software
00016   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #ifndef __JackMachServerChannel__
00021 #define __JackMachServerChannel__
00022 
00023 #include "JackChannel.h"
00024 #include "JackThread.h"
00025 #include "JackMachPort.h"
00026 #include <map>
00027 
00028 namespace Jack
00029 {
00030 
00031 class JackServer;
00032 class JackEngine;
00033 
00038 class JackMachServerChannel : public JackServerChannelInterface, public JackRunnableInterface
00039 {
00040 
00041     private:
00042 
00043         JackMachPortSet fServerPort;    
00044         JackThread* fThread;                    
00045         JackServer* fServer;
00046         std::map<mach_port_t, int> fClientTable;
00047 
00048         static boolean_t MessageHandler(mach_msg_header_t* Request, mach_msg_header_t* Reply);
00049 
00050     public:
00051 
00052         JackMachServerChannel();
00053         virtual ~JackMachServerChannel();
00054 
00055         int Open(const char* server_name, JackServer* server);  // Open the Server/Client connection
00056         void Close();                   // Close the Server/Client connection
00057 
00058         JackEngine* GetEngine();
00059         JackServer* GetServer();
00060 
00061                 void ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result);
00062         void ClientOpen(char* name, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result);
00063         void ClientClose(mach_port_t private_port, int refnum);
00064         void ClientKill(mach_port_t private_port);
00065 
00066         bool Execute();
00067 
00068         static std::map<mach_port_t, JackMachServerChannel*> fPortTable;
00069 };
00070 
00071 } // end of namespace
00072 
00073 #endif
00074 

Generated on Thu Feb 14 11:16:02 2008 for Jackdmp by  doxygen 1.5.1