FrameworkListener.h revision 168415b822cae1f8b54ef09c41c11a9b97b87f40
1168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat/* 2168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Copyright (C) 2008 The Android Open Source Project 3168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 4168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Licensed under the Apache License, Version 2.0 (the "License"); 5168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * you may not use this file except in compliance with the License. 6168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * You may obtain a copy of the License at 7168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 8168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * http://www.apache.org/licenses/LICENSE-2.0 9168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 10168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Unless required by applicable law or agreed to in writing, software 11168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * distributed under the License is distributed on an "AS IS" BASIS, 12168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * See the License for the specific language governing permissions and 14168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * limitations under the License. 15168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat */ 16168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#ifndef _FRAMEWORKSOCKETLISTENER_H 17168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#define _FRAMEWORKSOCKETLISTENER_H 18168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 19168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#include "SocketListener.h" 20168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#include "FrameworkCommand.h" 21168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 22168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatclass FrameworkListener : public SocketListener { 23168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatprivate: 24168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat FrameworkCommandCollection *mCommands; 25168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 26168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatpublic: 27168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat FrameworkListener(const char *socketName); 28168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat virtual ~FrameworkListener() {} 29168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 30168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatprotected: 31168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat void registerCmd(FrameworkCommand *cmd); 32168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat virtual bool onDataAvailable(int socket); 33168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 34168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatprivate: 35168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat void dispatchCommand(char *cmd); 36168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat}; 37168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#endif 38