blob: d69458693d2b06e9421fc007730f89707f3b2e5d [file] [log] [blame]
Chris Masonec1e50412011-06-07 13:04:53 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
Paul Stewart25379f12011-05-26 06:41:38 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Paul Stewartf0aae102011-10-19 12:11:44 -07005#ifndef SHILL_GLIB_IO_INPUT_HANDLER_
6#define SHILL_GLIB_IO_INPUT_HANDLER_
Paul Stewart25379f12011-05-26 06:41:38 -07007
8#include <stdio.h>
9#include <glib.h>
10
11#include <base/callback_old.h>
12
13#include "shill/io_handler.h"
14
15namespace shill {
16
Paul Stewart26b327e2011-10-19 11:38:09 -070017class GlibIOInputHandler : public IOHandler {
Paul Stewart25379f12011-05-26 06:41:38 -070018 public:
Paul Stewart26b327e2011-10-19 11:38:09 -070019 GlibIOInputHandler(int fd, Callback1<InputData*>::Type *callback);
20 ~GlibIOInputHandler();
Paul Stewartf0aae102011-10-19 12:11:44 -070021
22 virtual void Start();
23 virtual void Stop();
Paul Stewart26b327e2011-10-19 11:38:09 -070024
25 private:
Paul Stewart25379f12011-05-26 06:41:38 -070026 GIOChannel *channel_;
27 Callback1<InputData *>::Type *callback_;
28 guint source_id_;
Paul Stewart25379f12011-05-26 06:41:38 -070029};
30
31
32} // namespace shill
33
Paul Stewartf0aae102011-10-19 12:11:44 -070034#endif // SHILL_GLIB_IO_INPUT_HANDLER_