Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to mark a class of function is deprecated
How to mark a class of function is deprecated [message #36574] Sun, 10 June 2012 21:18 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello,

Reading more deeply C++ functionality I want to propose to implement a precompiled directive to mark for deprecated methods, properties, classes.

My code is:
#if defined(COMPILER_MSC)
	#define UPP_DEPRECATED __declspec(deprecated)
	#define UPP_DEPRECATED_T(text) __declspec(deprecated(#text))
#elif defined(COMPILER_GCC)||defined(COMPILER_MINGW)
	#define UPP_DEPRECATED __attribute__ ((deprecated))
	#define UPP_DEPRECATED_T(text) __attribute__ ((deprecated(#text)))
#else
	#define UPP_DEPRECATED
	#define UPP_DEPRECATED_T(text)
#endif



How it works:
  • for a class:
    class UPP_DEPRECATED_T("will be removed in 10.0 release") TempClass{...}
    
    or
    class UPP_DEPRECATED TempClass{...}
    
  • for a class method:
    class TempClass{
       int dep_method UPP_DEPRECATED_T("will be removed in 10.0 release");
    }
    
    or
    class TempClass{
       int dep_method UPP_DEPRECATED;
    }
    
  • for a function:
    UPP_DEPRECATED_T("will be removed in 10.0 release") void dep_function(){...}
    
    
    or
    UPP_DEPRECATED void dep_function(){...}
    


I'm proposing this solution because exist a lot of objects deprecated in U++ and we realize about this when it is completely removed.
/home/ilupascu/upp/uppsrc/Core/Vcont.h(82): int      GetIndex(const T& item) const; //deprecated
/home/ilupascu/upp/uppsrc/Core/Vcont.h(136)://deprecated
/home/ilupascu/upp/uppsrc/Core/Stream.h(231)://* deprecated
/home/ilupascu/upp/uppsrc/Core/Stream.h(353):  DELETESHARE = 0x20, // deprecated
/home/ilupascu/upp/uppsrc/Core/Stream.h(354):  NOREADSHARE = 0x40, // deprecated
/home/ilupascu/upp/uppsrc/Core/Win32Util.h(48)://deprecated
/home/ilupascu/upp/uppsrc/Core/Win32Util.h(63)://deprecated
/home/ilupascu/upp/uppsrc/Core/Value.h(170): static  void Register(dword w, Void* (*c)(), const char *name = NULL) init_; // Direct use deprecated
/home/ilupascu/upp/uppsrc/Core/Lang.h(16):#define LNG_CZECH         0xF1CC7A // Deprecated, corresponds to CS-CZ windows-1250
/home/ilupascu/upp/uppsrc/Core/Value.hpp(307):template <class T> // Deprecated, use Value::Is
/home/ilupascu/upp/uppsrc/Core/Value.hpp(310):template <class T> // deprecated, use Value::Is
/home/ilupascu/upp/uppsrc/Core/Value.hpp(314):struct RawValue : public Value { // Deprecated, use RawToValue and Value::To
/home/ilupascu/upp/uppsrc/Core/Value.hpp(321):struct RichValue : public Value { // Deprecated, use RichToValue and Value::To
/home/ilupascu/upp/uppsrc/Core/Value.hpp(328):template <class T> // Deprecated, use Value::To
/home/ilupascu/upp/uppsrc/Core/Value.hpp(331):template <class T> // Deprecated, use Value::To
/home/ilupascu/upp/uppsrc/Core/Value.hpp(335):template <class T> // Deprecated (?)
/home/ilupascu/upp/uppsrc/Core/Value.hpp(344):Ref RawAsRef(T& x) { // Deprecated (?)
/home/ilupascu/upp/uppsrc/Core/Value.hpp(348):template <class T> // Deprecated
/home/ilupascu/upp/uppsrc/Core/Value.hpp(356):template <class T> // Deprecated
/home/ilupascu/upp/uppsrc/Core/Defs.h(178):// deprecated, use INITBLOCK
/home/ilupascu/upp/uppsrc/Core/Defs.h(192):// deprecated, use EXITBLOCK
/home/ilupascu/upp/uppsrc/Core/Mt.h(556):typedef Mutex CriticalSection; // deprecated
/home/ilupascu/upp/uppsrc/Core/Mt.h(557):typedef StaticMutex StaticCriticalSection; // deprecated
/home/ilupascu/upp/uppsrc/Core/Global.h(29):// DEPRECATED! (USE ONCELOCK_)
/home/ilupascu/upp/uppsrc/Core/Global.h(40):// DEPRECATED! (USE ONCELOCK)


Also this can be used for custom packages to take in account the impact to other packages.

Any hints and advices are welcome.

[Updated on: Sun, 10 June 2012 21:21]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: String isn't pickable?
Next Topic: What`s the corect way to use TimingInspector?
Goto Forum:
  


Current Time: Sat Apr 27 22:22:54 CEST 2024

Total time taken to generate the page: 0.07201 seconds