• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

spl/io/Stream.h

00001 /*
00002  *   This file is part of the Standard Portable Library (SPL).
00003  *
00004  *   SPL 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 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   SPL 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 SPL.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #ifndef _stream2_h
00018 #define _stream2_h
00019 
00020 #include <stdio.h>
00021 
00022 #include <spl/types.h>
00023 #include <spl/Debug.h>
00024 #include <spl/threading/Event.h>
00025 #include <spl/threading/Mutex.h>
00026 #include <spl/io/IStream.h>
00027 #include <spl/Memory.h>
00028 #include <spl/RefCountPtrCast.h>
00029 #include <spl/String.h>
00030 #include <spl/collection/Vector.h>
00031 #include <spl/WeakReference.h>
00032 
00047 class IStreamState : public spl::IStream
00048 {
00049 protected:
00050         spl::IStream *m_parent;
00051         IStreamState **m_holder;
00052 
00053         void ChangeState(IStreamState *newState);
00054 public:
00055         IStreamState( spl::IStream *parent, IStreamState **parentStateVar );
00056         virtual ~IStreamState();
00057 
00058         virtual void OnLeave(IStreamState *newState) = 0;
00059         virtual void OnEnter(IStreamState *oldState) = 0;
00060 };
00061 
00062 REGISTER_TYPEOF(124, IStreamState);
00063 
00067 #endif