Permalink
Browse files

moved default deconstructors into header to let them count as trivial.

  • Loading branch information...
turleypol committed Nov 3, 2018
1 parent 0d4cca7 commit ea9f5afd45a0f001ea225df4ff504cfe0473cac8
@@ -365,9 +365,8 @@ class BObject final : public ref_counted
public:
explicit BObject( BObjectImp* objimp ) : ref_counted(), objimp( objimp ) { passert( objimp ); }
BObject( const BObject& obj ) : ref_counted(), objimp( obj.objimp ) {}
~BObject();
~BObject() = default;
// NOTE: BObject should not be derived from!
size_t sizeEstimate() const;
void* operator new( std::size_t len );
@@ -538,8 +537,7 @@ class ObjArray final : public BObjectImp
virtual BObjectImp* call_method( const char* methodname, Executor& ex ) override;
virtual BObjectImp* call_method_id( const int id, Executor& ex,
bool forcebuiltin = false ) override;
virtual BObjectRef set_member( const char* membername, BObjectImp* value,
bool copy ) override;
virtual BObjectRef set_member( const char* membername, BObjectImp* value, bool copy ) override;
virtual BObjectRef get_member( const char* membername ) override;
void addElement( BObjectImp* imp );
@@ -954,6 +952,6 @@ T* BApplicObj<T>::operator->()
{
return &obj_;
}
}
}
} // namespace Bscript
} // namespace Pol
#endif
@@ -79,14 +79,6 @@ CompilerContext::CompilerContext( const std::string& filename, int dbg_filenum,
{
}
CompilerContext::CompilerContext( const CompilerContext& ctx )
= default;
CompilerContext& CompilerContext::operator=( const CompilerContext& rhs )
= default;
/**
* Skips whitespaces. Moves the pointer forward until a non-whitespace is found
*/
@@ -27,8 +27,8 @@ class CompilerContext
public:
CompilerContext();
CompilerContext( const std::string& filename, int dbg_filenum, const char* s );
CompilerContext( const CompilerContext& );
CompilerContext& operator=( const CompilerContext& );
CompilerContext( const CompilerContext& ) = default;
CompilerContext& operator=( const CompilerContext& ) = default;
void printOn( std::ostream& os ) const;
void printOn( fmt::Writer& writer ) const;
@@ -18,8 +18,6 @@ ModuleFunction::ModuleFunction( const char* fname, int i_nargs, UserFunction* i_
{
}
ModuleFunction::~ModuleFunction() = default;
FunctionalityModule::FunctionalityModule( const char* i_modname )
: have_indexes( false ), modulename( i_modname )
{
@@ -33,7 +33,7 @@ class ModuleFunction
bool used; // compiler only
ModuleFunction( const char* fname, int nargs, UserFunction* uf );
~ModuleFunction();
~ModuleFunction() = default;
};
class FunctionalityModule
@@ -123,9 +123,6 @@ BObjectImp* BObjectImp::unpack( const char* pstr )
return unpack( is );
}
BObject::~BObject() = default;
BObject* BObject::clone() const
{
return new BObject( objimp->copy() );
@@ -52,6 +52,5 @@ UserFunction::UserFunction()
{
}
UserFunction::~UserFunction() = default;
}
}
@@ -34,7 +34,7 @@ class UserFunction
{
public:
UserFunction();
~UserFunction();
~UserFunction() = default;
std::string name;
typedef std::vector<UserParam> Parameters;
@@ -16,11 +16,6 @@ std::string ProgramConfig::m_programDir = "";
///////////////////////////////////////////////////////////////////////////////
ProgramConfig::ProgramConfig() = default;
ProgramConfig::~ProgramConfig() = default;
///////////////////////////////////////////////////////////////////////////////
void ProgramConfig::configureProgramEnvironment( const std::string& programName )
{
m_programName = programName;
@@ -10,8 +10,8 @@ namespace Clib
class ProgramConfig
{
public:
ProgramConfig();
virtual ~ProgramConfig();
ProgramConfig() = default;
virtual ~ProgramConfig() = default;
/**
* @brief Returns the name of the currently running program
@@ -34,8 +34,8 @@ class ProgramConfig
static std::string m_programName;
static std::string m_programDir;
};
}
} // namespaces
} // namespace Clib
} // namespace Pol
#define PROG_CONFIG Pol::Clib::ProgramConfig
@@ -439,7 +439,6 @@ void LogSink_debuglog::addMessage( fmt::Writer* msg, const std::string& )
LogSink_leaklog::LogSink_leaklog() : LogSinkGenericFile( &leaklogBehaviour ) {}
LogSink_flexlog::LogSink_flexlog() : LogSink() {}
LogSink_flexlog::~LogSink_flexlog() = default;
// create and open new logfile with given name, returns unique id
std::string LogSink_flexlog::create( std::string logfilename, bool open_timestamp )
@@ -59,7 +59,7 @@ class LogSink_cout final : public LogSink
{
public:
LogSink_cout();
virtual ~LogSink_cout(){};
virtual ~LogSink_cout() = default;
virtual void addMessage( fmt::Writer* msg ) override;
virtual void addMessage( fmt::Writer* msg, const std::string& id ) override;
};
@@ -69,7 +69,7 @@ class LogSink_cerr final : public LogSink
{
public:
LogSink_cerr();
virtual ~LogSink_cerr(){};
virtual ~LogSink_cerr() = default;
virtual void addMessage( fmt::Writer* msg ) override;
virtual void addMessage( fmt::Writer* msg, const std::string& id ) override;
};
@@ -79,7 +79,7 @@ class LogSink_pollog final : public LogSinkGenericFile
{
public:
LogSink_pollog();
virtual ~LogSink_pollog(){};
virtual ~LogSink_pollog() = default;
void deinitialize_startlog();
};
@@ -88,15 +88,15 @@ class LogSink_scriptlog final : public LogSinkGenericFile
{
public:
LogSink_scriptlog();
virtual ~LogSink_scriptlog(){};
virtual ~LogSink_scriptlog() = default;
};
// debug.log file sink
class LogSink_debuglog final : public LogSinkGenericFile
{
public:
LogSink_debuglog();
virtual ~LogSink_debuglog(){};
virtual ~LogSink_debuglog() = default;
virtual void addMessage( fmt::Writer* msg ) override;
virtual void addMessage( fmt::Writer* msg, const std::string& id ) override;
void disable();
@@ -108,14 +108,14 @@ class LogSink_leaklog final : public LogSinkGenericFile
{
public:
LogSink_leaklog();
virtual ~LogSink_leaklog(){};
virtual ~LogSink_leaklog() = default;
};
class LogSink_flexlog final : public LogSink
{
public:
LogSink_flexlog();
virtual ~LogSink_flexlog();
virtual ~LogSink_flexlog() = default;
std::string create( std::string logfilename, bool open_timestamp );
virtual void addMessage( fmt::Writer* msg ) override;
virtual void addMessage( fmt::Writer* msg, const std::string& id ) override;
@@ -130,7 +130,7 @@ class LogSink_dual final : public LogSink
{
public:
LogSink_dual();
virtual ~LogSink_dual(){};
virtual ~LogSink_dual() = default;
virtual void addMessage( fmt::Writer* msg ) override;
virtual void addMessage( fmt::Writer* msg, const std::string& id ) override;
};
@@ -13,7 +13,6 @@ const std::size_t flush_limit = 10000; // 500;
/// BaseClass implements only writer operator logic
StreamWriter::StreamWriter() : _writer( new fmt::Writer ) {}
StreamWriter::~StreamWriter() = default;
fmt::Writer& StreamWriter::operator()()
{
@@ -21,7 +21,7 @@ class StreamWriter : boost::noncopyable
{
public:
StreamWriter();
virtual ~StreamWriter();
virtual ~StreamWriter() = default;
fmt::Writer& operator()();
virtual void init( const std::string& filepath ) = 0;
virtual void flush() = 0;
@@ -25,8 +25,6 @@ InMemoryMapServer::InMemoryMapServer( const RealmDescriptor& descriptor ) : MapS
mapfile.Read( &_mapblocks[0], n_blocks );
}
InMemoryMapServer::~InMemoryMapServer() = default;
MAPCELL InMemoryMapServer::GetMapCell( unsigned short x, unsigned short y ) const
{
passert( x < _descriptor.width && y < _descriptor.height );
@@ -30,7 +30,7 @@ class InMemoryMapServer : public MapServer
{
public:
explicit InMemoryMapServer( const RealmDescriptor& descriptor );
virtual ~InMemoryMapServer();
virtual ~InMemoryMapServer() = default;
virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const override;
virtual size_t sizeEstimate() const override;
@@ -33,8 +33,6 @@ MapServer::MapServer( const RealmDescriptor& descriptor ) : _descriptor( descrip
LoadFirstLevelIndex();
}
MapServer::~MapServer() = default;
void MapServer::LoadSolids()
{
std::string filename = _descriptor.path( "solids.dat" );
@@ -24,7 +24,7 @@ class MapServer
public:
static MapServer* Create( const RealmDescriptor& descriptor );
virtual ~MapServer();
virtual ~MapServer() = default;
virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const = 0;
void GetMapShapes( MapShapeList& list, unsigned short x, unsigned short y,
@@ -19,8 +19,6 @@ MapTileServer::MapTileServer( const RealmDescriptor& descriptor )
_cur_block_index = 0;
}
MapTileServer::~MapTileServer() = default;
MAPTILE_CELL MapTileServer::GetMapTile( unsigned short x, unsigned short y )
{
unsigned short xblock = x >> MAPTILE_SHIFT;
@@ -19,7 +19,7 @@ class MapTileServer
{
public:
explicit MapTileServer( const RealmDescriptor& descriptor );
~MapTileServer();
~MapTileServer() = default;
MAPTILE_CELL GetMapTile( unsigned short x, unsigned short y );
size_t sizeEstimate() const;
@@ -42,8 +42,6 @@ StaticServer::StaticServer( const RealmDescriptor& descriptor )
Validate();
}
StaticServer::~StaticServer() = default;
void StaticServer::Validate() const
{
POLLOG_INFO << "Validating statics files: ";
@@ -29,7 +29,7 @@ class StaticServer
{
public:
explicit StaticServer( const RealmDescriptor& descriptor );
~StaticServer();
~StaticServer() = default;
StaticServer& operator=( const StaticServer& ) { return *this; }
bool findstatic( unsigned short x, unsigned short y, unsigned short objtype ) const;
void getstatics( StaticEntryList& statics, unsigned short x, unsigned short y ) const;
@@ -22,7 +22,6 @@ SystemState::SystemState()
tiles_loaded( false )
{
}
SystemState::~SystemState() = default;
void SystemState::deinitialize()
{
@@ -31,7 +31,7 @@ class SystemState : boost::noncopyable
{
public:
SystemState();
~SystemState();
~SystemState() = default;
void deinitialize();
Packages packages;
Oops, something went wrong.

0 comments on commit ea9f5af

Please sign in to comment.