Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Boboobooov4 by
Stack.h
00001 /* 00002 * mbed library for Stack 00003 * Copyright (c) 2011 Hiroshi Suga 00004 * Released under the MIT License: http://mbed.org/license/mit 00005 */ 00006 00007 /** @file Stack.h 00008 * @brief Stack 00009 */ 00010 00011 #ifndef Stack_H 00012 #define Stack_H 00013 00014 #include "mbed.h" 00015 00016 /** Stack class 00017 */ 00018 template <class T> 00019 class Stack { 00020 public: 00021 /** init Stack class 00022 * @param p_size size of stack 00023 */ 00024 Stack (int p_size); 00025 ~Stack (); 00026 00027 /** push to stack 00028 * @param dat data 00029 * @return data or -1:error 00030 */ 00031 int push (T dat); 00032 00033 /** pop from stack 00034 * @param dat data 00035 * @return 0:ok / -1:error 00036 */ 00037 int pop (T *dat); 00038 00039 int read (T *dat); 00040 00041 void clear (); 00042 int available (); 00043 int use (); 00044 00045 private: 00046 T *buf; 00047 int size; 00048 int addr; 00049 }; 00050 00051 #endif
Generated on Thu Jul 14 2022 03:30:21 by
1.7.2
