Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Last active August 29, 2015 14:06
Show Gist options
  • Save arajkumar/fa9b3836630aeaed1361 to your computer and use it in GitHub Desktop.
Save arajkumar/fa9b3836630aeaed1361 to your computer and use it in GitHub Desktop.
// interface
namespace blaze {
class ProcessStatusProvider {
class Status {
pid_t pid_;
size_t private_mem_;
size_t shared_mem_;
size_t gpu_mem_;
bool is_extended;
// refer below properties only if is_extended == true;
size_t js_heap_;
size_t image_cache_;
size_t css_cache_;
};
typedef boost::function<void(const std::map<pid_t, Status>&)> StatusCallback;
static void GetCurrentStatus(const StatusCallback& callback, bool extended = false);
};
}
// usage
void GetCurrentStatusCallback(const std::map<pid_t, Status>& status) {
//
}
blaze::ProcessStatusProvider::GetCurrentStatus(boost::bind(GetCurrentStatusCallback));
blaze::ProcessStatusProvider::GetCurrentStatus(boost::bind(GetCurrentStatusCallback), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment