// ------------------------------------------------------------------------------------------------ void Buffer::Grow(SzType n) { // Backup the current memory Buffer bkp(m_Ptr, m_Cap, m_Cur, m_Mem); // Acquire a bigger buffer Request(bkp.m_Cap + n); // Copy the data from the old buffer std::memcpy(m_Ptr, bkp.m_Ptr, bkp.m_Cap); // Copy the previous edit cursor m_Cur = bkp.m_Cur; }
int main(int argc, char** argv) { ros::init(argc, argv, "bk_planner_node"); ros::NodeHandle nh; tf::TransformListener tf(ros::Duration(10)); try { bk_planner::BKPlanner bkp("bk_planner", tf); // All callbacks are taken care of in the main thread while(nh.ok()) { ros::spinOnce(); } } // The planner will go out of scope here and call its destructor. // It might throw a lock error because of interraction between the threads and mutexes catch(boost::lock_error e) { cout << "Boost threw a lock error (" << e.what() << ")\n"; cout << "Honey Badger don't care, Honey Badger don't give a &$%#\n\n"; } return(0); }