jcontainer.h | jcontainer.h | |||
---|---|---|---|---|
skipping to change at line 167 | skipping to change at line 167 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void SetInsets(int left, int top, int right, int bot tom); | virtual void SetInsets(int left, int top, int right, int bot tom); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void Add(Component *c, jborderlayout_align_t align = | virtual void Add(Component *c, int index); | |||
BL_CENTER); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void Add(Component *c); | ||||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void Add(Component *c, GridBagConstraints *constrain ts); | virtual void Add(Component *c, GridBagConstraints *constrain ts); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void Add(Component *c, std::string id); | virtual void Add(Component *c, std::string id); | |||
/** | /** | |||
* \brief Appends the specified component to the end of this | ||||
container. | ||||
* | ||||
*/ | ||||
virtual void Add(Component *c, jborderlayout_align_t align); | ||||
/** | ||||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void Remove(Component *c); | virtual void Remove(Component *c); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void RemoveAll(); | virtual void RemoveAll(); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 14 lines changed or added | |||
jfile.h | jfile.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
#include <string.h> | #include <string.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
namespace jio { | namespace jio { | |||
/** | /** | |||
* \brief Tipo de arquivo. | * \brief Tipo de arquivo. | |||
* | * | |||
*/ | */ | |||
enum jfile_type_t { | enum jfile_type_t { | |||
F_UNKNOWN, | ||||
F_REGULAR, | F_REGULAR, | |||
F_DIRECTORY, | F_DIRECTORY, | |||
F_CHAR_DEVICE, | F_CHAR_DEVICE, | |||
F_COMPRESS, | F_COMPRESS, | |||
F_ENCRYPTED, | F_ENCRYPTED, | |||
F_HIDDEN, | F_HIDDEN, | |||
F_OFFLINE, | F_OFFLINE, | |||
F_SYSTEM, | F_SYSTEM, | |||
F_BLOCK_DEVICE, | F_BLOCK_DEVICE, | |||
F_FIFO, | F_FIFO, | |||
F_SYMBOLIC_LINK, | F_SYMBOLIC_LINK, | |||
F_SOCKET, | F_SOCKET, | |||
F_UNKNOWN | ||||
}; | }; | |||
/** | /** | |||
* \brief Flags de arquivo. | * \brief Flags de arquivo. | |||
* | * | |||
*/ | */ | |||
enum jfile_flags_t { | enum jfile_flags_t { | |||
F_WRITE_ONLY = 0x0001, | F_WRITE_ONLY = 0x0001, | |||
F_READ_ONLY = 0x0002, | F_READ_ONLY = 0x0002, | |||
F_READ_WRITE = 0x0004, | F_READ_WRITE = 0x0004, | |||
F_EXCLUSIVE = 0x0008, | F_EXCLUSIVE = 0x0008, | |||
F_TRUNCATE = 0x0010, | F_TRUNCATE = 0x0010, | |||
F_APPEND = 0x0020, | F_APPEND = 0x0020, | |||
F_NON_BLOCK = 0x0040, | F_NON_BLOCK = 0x0040, | |||
F_SYNC = 0x0080, | F_SYNC = 0x0080, | |||
F_NON_FOLLOW = 0x0100, | F_NON_FOLLOW = 0x0100, | |||
F_DIR = 0x0200, | F_DIR = 0x0200, | |||
F_ASYNC = 0x0400, | F_ASYNC = 0x0400, | |||
F_LARGEFILE = 0x0800, | F_LARGEFILE = 0x0800, | |||
F_CREATE = 0x1000, | F_CREATE = 0x1000, | |||
}; | }; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
* \author Jeff Ferr | * \author Jeff Ferr | |||
*/ | */ | |||
class File : public virtual jcommon::Object{ | class File : public virtual jcommon::Object{ | |||
private: | private: | |||
skipping to change at line 116 | skipping to change at line 116 | |||
/** \brief */ | /** \brief */ | |||
bool _is_closed; | bool _is_closed; | |||
/** \brief */ | /** \brief */ | |||
bool _exists; | bool _exists; | |||
private: | private: | |||
/** | /** | |||
* \brief Construtor. | * \brief Construtor. | |||
* | * | |||
*/ | */ | |||
File(std::string prefix, std::string sufix); | File(std::string prefix, std::string sufix, bool is_director y); | |||
public: | public: | |||
/** | /** | |||
* \brief Create a new file. | * \brief Create a new file. | |||
* | * | |||
*/ | */ | |||
File(std::string filename_, int = F_READ_ONLY | F_LARGEFILE) ; | File(std::string filename_, int = F_READ_ONLY | F_LARGEFILE) ; | |||
/** | /** | |||
* \brief Create a new directory. | * \brief Create a new directory. | |||
skipping to change at line 159 | skipping to change at line 159 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
static std::string NormalizePath(std::string pathname); | static std::string NormalizePath(std::string pathname); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
static File * CreateTemporary(std::string prefix, std::strin | static File * CreateTemporaryFile(std::string prefix, std::s | |||
g sufix = std::string("")); | tring sufix = std::string("")); | |||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
static File * CreateTemporaryDirectory(std::string prefix, s | ||||
td::string sufix = std::string("")); | ||||
/** | /** | |||
* \brief Retorna o descritor para o arquivo. | * \brief Retorna o descritor para o arquivo. | |||
* | * | |||
*/ | */ | |||
#ifdef _WIN32 | #ifdef _WIN32 | |||
HANDLE GetFileDescriptor(); | HANDLE GetFileDescriptor(); | |||
#else | #else | |||
int GetFileDescriptor(); | int GetFileDescriptor(); | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
9 lines changed or deleted | 16 lines changed or added | |||
jfilechooserdialogbox.h | jfilechooserdialogbox.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* This program is distributed in the hope that it will be useful, * | * This program is distributed in the hope that it will be useful, * | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |||
* GNU General Public License for more details. * | * GNU General Public License for more details. * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License * | * You should have received a copy of the GNU General Public License * | |||
* along with this program; if not, write to the * | * along with this program; if not, write to the * | |||
* Free Software Foundation, Inc., * | * Free Software Foundation, Inc., * | |||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef J_FILESYSTEMDIALOG_H | #ifndef J_FILESYSTEMDIALOGBOX_H | |||
#define J_FILESYSTEMDIALOG_H | #define J_FILESYSTEMDIALOGBOX_H | |||
#include "jframe.h" | #include "jframe.h" | |||
#include "jselectlistener.h" | #include "jselectlistener.h" | |||
#include "jlistbox.h" | #include "jlistbox.h" | |||
#include "jlabel.h" | #include "jlabel.h" | |||
#include "jmutex.h" | #include "jmutex.h" | |||
#include "jtextfield.h" | #include "jtextfield.h" | |||
#include <string> | #include <string> | |||
#include <iostream> | #include <iostream> | |||
skipping to change at line 63 | skipping to change at line 63 | |||
FILE_ONLY, | FILE_ONLY, | |||
DIRECTORY_ONLY, | DIRECTORY_ONLY, | |||
FILE_AND_DIRECTORY | FILE_AND_DIRECTORY | |||
}; | }; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
* \author Jeff Ferr | * \author Jeff Ferr | |||
*/ | */ | |||
class FileChooserDialog : public jgui::Frame, public jgui::SelectListener, public jgui::FrameInputListener{ | class FileChooserDialogBox : public jgui::Frame, public jgui::SelectListene r, public jgui::FrameInputListener{ | |||
private: | private: | |||
jthread::Mutex _filesystem_mutex; | ||||
std::vector<std::string> _extensions; | std::vector<std::string> _extensions; | |||
jgui::Label *label; | jthread::Mutex _mutex; | |||
jgui::ListBox *list; | jgui::Label *_label; | |||
jgui::TextField *file; | jgui::ListBox *_list; | |||
jgui::TextField *_file; | ||||
std::string _base_dir, | std::string _base_dir, | |||
_current_dir; | _current_dir; | |||
jfilechooser_type_t _type; | jfilechooser_type_t _type; | |||
jfilechooser_filter_t _filter; | jfilechooser_filter_t _filter; | |||
bool _has_parent, | bool _has_parent, | |||
_extension_ignorecase; | _extension_ignorecase; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
void ShowFiles(); | bool ShowFiles(std::string current_dir); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
std::vector<std::string> * ListFiles(std::string dirPath); | std::vector<std::string> * ListFiles(std::string dirPath); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
skipping to change at line 109 | skipping to change at line 108 | |||
* | * | |||
*/ | */ | |||
bool IsFile(std::string path); | bool IsFile(std::string path); | |||
public: | public: | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
FileChooserDialog(std::string title, std::string directory, int x, int y, jfilechooser_type_t type = OPEN_FILE_DIALOG); | FileChooserDialogBox(std::string title, std::string director y, int x, int y, jfilechooser_type_t type = OPEN_FILE_DIALOG); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual ~FileChooserDialog(); | virtual ~FileChooserDialogBox(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual std::string GetName(); | virtual std::string GetName(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
skipping to change at line 171 | skipping to change at line 170 | |||
* | * | |||
*/ | */ | |||
virtual void ItemSelected(jgui::SelectEvent *event); | virtual void ItemSelected(jgui::SelectEvent *event); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void InputChanged(jgui::KeyEvent *event); | virtual void InputChanged(jgui::KeyEvent *event); | |||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual bool Show(bool modal = true); | ||||
}; | }; | |||
} | } | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
17 lines changed or deleted | 10 lines changed or added | |||
jgraphics.h | jgraphics.h | |||
---|---|---|---|---|
skipping to change at line 411 | skipping to change at line 411 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void SetColor(int r, int g, int b, int a = 0xff); | virtual void SetColor(int r, int g, int b, int a = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool HasFont(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void SetFont(Font *font); | virtual void SetFont(Font *font); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual Font * GetFont(); | virtual Font * GetFont(); | |||
/** | /** | |||
* \brief | * \brief | |||
skipping to change at line 663 | skipping to change at line 669 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void GetStringBreak(std::vector<std::string> *lines, | ||||
std::string text, int wp, int hp, jhorizontal_align_t halign = JUSTIFY_HAL | ||||
IGN); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void DrawString(std::string s, int x, int y); | virtual void DrawString(std::string s, int x, int y); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void DrawString(std::string full_text, int x, int y, int width, int height, jhorizontal_align_t halign = JUSTIFY_HALIGN, jverti cal_align_t valign = CENTER_VALIGN); | virtual void DrawString(std::string full_text, int x, int y, int width, int height, jhorizontal_align_t halign = JUSTIFY_HALIGN, jverti cal_align_t valign = CENTER_VALIGN, bool clipped = true); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf f000000); | virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf f000000); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 15 lines changed or added | |||
jinputstream.h | jinputstream.h | |||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual ~InputStream(); | virtual ~InputStream(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
void SetBlocking(bool block_); | virtual void SetBlocking(bool block_); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
bool IsBlocking(); | virtual bool IsBlocking(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool IsEmpty() = 0; | virtual bool IsEmpty() = 0; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
jnullgraphics.h | jnullgraphics.h | |||
---|---|---|---|---|
skipping to change at line 83 | skipping to change at line 83 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void SetClip(int x, int y, int width, int height); | virtual void SetClip(int x, int y, int width, int height); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual jregion_t GetClipBounds(); | virtual jregion_t GetClip(); | |||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual int GetClipX(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual int GetClipY(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual int GetClipWidth(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual int GetClipHeight(); | ||||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void ReleaseClip(); | virtual void ReleaseClip(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
skipping to change at line 185 | skipping to change at line 161 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void SetColor(int r, int g, int b, int a = 0xFF); | virtual void SetColor(int r, int g, int b, int a = 0xFF); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool HasFont(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void SetFont(Font *font); | virtual void SetFont(Font *font); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void SetPorterDuffFlags(jporter_duff_flags_t t); | virtual void SetPorterDuffFlags(jporter_duff_flags_t t); | |||
/** | /** | |||
* \brief | * \brief | |||
skipping to change at line 359 | skipping to change at line 341 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void FillGradientRectangle(int x, int y, int w, int h, int sr, int sg, int sb, int sa, int dr, int dg, int db, int da = 0xFF, b ool horizontal = true); | virtual void FillGradientRectangle(int x, int y, int w, int h, int sr, int sg, int sb, int sa, int dr, int dg, int db, int da = 0xFF, b ool horizontal = true); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void GetStringBreak(std::vector<std::string> *lines, | ||||
std::string text, int wp, int hp, jhorizontal_align_t halign = JUSTIFY_HAL | ||||
IGN); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void DrawString(std::string s, int x, int y); | virtual void DrawString(std::string s, int x, int y); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void DrawString(std::string full_text, int x, int y, | ||||
int width, int height, jhorizontal_align_t halign = JUSTIFY_HALIGN, jverti | ||||
cal_align_t valign = CENTER_VALIGN, bool clipped = true); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
virtual void DrawGlyph(int symbol, int xp, int yp); | virtual void DrawGlyph(int symbol, int xp, int yp); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff); | virtual bool DrawImage(std::string img, int x, int y, int al pha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
skipping to change at line 395 | skipping to change at line 389 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(std::string img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | virtual bool DrawImage(std::string img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(OffScreenImage *img, int x, int y, in t w, int h, int alpha = 0xff); | virtual bool DrawImage(OffScreenImage *img, int x, int y, in t alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int alpha = 0xff); | virtual bool DrawImage(OffScreenImage *img, int x, int y, in t w, int h, int alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual void DrawString(std::string full_text, int x, int y, int width, int height, jhorizontal_align_t halign = JUSTIFY_HALIGN, jverti cal_align_t valign = CENTER_VALIGN); | virtual bool DrawImage(OffScreenImage *img, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int alpha = 0xff); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf f000000); | virtual uint32_t GetRGB(int xp, int yp, uint32_t pixel = 0xf f000000); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
End of changes. 8 change blocks. | ||||
29 lines changed or deleted | 27 lines changed or added | |||
jobservable.h | jobservable.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License * | * You should have received a copy of the GNU General Public License * | |||
* along with this program; if not, write to the * | * along with this program; if not, write to the * | |||
* Free Software Foundation, Inc., * | * Free Software Foundation, Inc., * | |||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |||
a************************************************************************* **/ | a************************************************************************* **/ | |||
#ifndef J_OBSERVABLE_H | #ifndef J_OBSERVABLE_H | |||
#define J_OBSERVABLE_H | #define J_OBSERVABLE_H | |||
#include "jobserver.h" | #include "jobserver.h" | |||
#include "jobject.h" | #include "jmutex.h" | |||
#include <string> | #include <string> | |||
#include <vector> | #include <vector> | |||
#include <algorithm> | #include <algorithm> | |||
#include <stdint.h> | #include <stdint.h> | |||
namespace jcommon { | namespace jcommon { | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
* \author Jeff Ferr | * \author Jeff Ferr | |||
*/ | */ | |||
class Observable : public virtual jcommon::Object{ | class Observable : public virtual jcommon::Object{ | |||
private: | private: | |||
std::vector<Observer *> _observers; | std::vector<Observer *> _observers; | |||
jthread::Mutex _mutex; | ||||
bool _changed; | bool _changed; | |||
public: | public: | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
Observable(); | Observable(); | |||
/** | /** | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
joutputstream.h | joutputstream.h | |||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual int64_t Available() = 0; | virtual int64_t Available() = 0; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
void SetBlocking(bool block_); | virtual void SetBlocking(bool block_); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
bool IsBlocking(); | virtual bool IsBlocking(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
virtual int64_t GetSize() = 0; | virtual int64_t GetSize() = 0; | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
jspinlock.h | jspinlock.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
#ifdef _WIN32 | #ifdef _WIN32 | |||
#include <windows.h> | #include <windows.h> | |||
#include <winuser.h> | #include <winuser.h> | |||
#include <winbase.h> | #include <winbase.h> | |||
#include <string> | #include <string> | |||
#else | #else | |||
#endif | #endif | |||
struct jspinlock_t { | struct jspinlock_t { | |||
volatile unsigned long lock; | #ifdef _WIN32 | |||
volatile unsigned long lock; | ||||
#else | ||||
pthread_spinlock_t lock; | ||||
#endif | ||||
}; | }; | |||
namespace jthread { | namespace jthread { | |||
/** | /** | |||
* \brief Semaphore. | * \brief Semaphore. | |||
* | * | |||
* @author Jeff Ferr | * @author Jeff Ferr | |||
*/ | */ | |||
class SpinLock : public virtual jcommon::Object{ | class SpinLock : public virtual jcommon::Object{ | |||
private: | private: | |||
jspinlock_t _lock; | jspinlock_t _lock; | |||
public: | public: | |||
/** | /** | |||
* \brief Construtor. | * \brief Construtor. | |||
* | * | |||
*/ | */ | |||
SpinLock(); | SpinLock(); | |||
/** | ||||
* \brief Destrutor virtual. | ||||
* | ||||
*/ | ||||
virtual ~SpinLock(); | ||||
/** | ||||
* \brief Lock the semaphore. | ||||
* | ||||
*/ | ||||
void Lock(); | ||||
/** | ||||
* \brief Notify the locked semaphore. | ||||
* | ||||
*/ | ||||
void Unlock(); | ||||
/** | ||||
* \brief Try lock the semaphore. | ||||
* | ||||
*/ | ||||
bool TryLock(); | ||||
/** | ||||
* \brief | ||||
* | ||||
*/ | ||||
void Release(); | ||||
}; | ||||
class SpinLockReentrant{ | ||||
private: | ||||
SpinLock _RealCS; | ||||
unsigned int _nLockCount; | ||||
unsigned int _nOwner; | ||||
public: | ||||
/** | ||||
* \brief Construtor. | ||||
* | ||||
*/ | ||||
SpinLockReentrant(); | ||||
/** | /** | |||
* \brief Destrutor virtual. | * \brief Destrutor virtual. | |||
* | * | |||
*/ | */ | |||
virtual ~SpinLockReentrant(); | virtual ~SpinLock(); | |||
/** | /** | |||
* \brief Lock the semaphore. | * \brief Lock the semaphore. | |||
* | * | |||
*/ | */ | |||
void Enter(unsigned int pnumber); | void Lock(); | |||
/** | /** | |||
* \brief Notify the locked semaphore. | * \brief Notify the locked semaphore. | |||
* | * | |||
*/ | */ | |||
void Leave(unsigned int pnumber); | void Unlock(); | |||
/** | /** | |||
* \brief Try lock the semaphore. | * \brief Try lock the semaphore. | |||
* | * | |||
*/ | */ | |||
bool TryEnter(unsigned int pnumber); | bool TryLock(); | |||
/** | /** | |||
* \brief | * \brief | |||
* | * | |||
*/ | */ | |||
void Release(); | void Release(); | |||
}; | }; | |||
} | } | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
78 lines changed or deleted | 37 lines changed or added | |||