Skip to content

Instantly share code, notes, and snippets.

Avatar

Mirko Geissler xadh00m

View GitHub Profile
View BackgroundManager.java
package com.android.utils;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.os.Handler;
import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
View Main.cpp
// create the dependency list
DependencyList dependencyList;
// (...gather all required dependencies and add them to the list...)
// create the plugin instance
Plugin* plugin = createPlugin();
// create a shared pointer managing the lifetime of the plugin and its dependencies
PluginPtr pluginPtr(plugin, DependencyDeleter<plugin>(dependencyList));
View DependencyDeleter.h
// Type definition for a list of boost::any instances.
typedef std::vector DependencyList;
// Stores all dependencies
template struct DependencyDeleter
{
// Constructor is initialized with the list of dependencies
DependencyDeleter(DependencyList dependencies) : mDependencies(dependencies)
{}
You can’t perform that action at this time.