void HostServicesPlugin::requestCredentials(SecureConnectionPtr connection)
{
  if (!m_host->isMainThread())
  {
    m_host->ScheduleOnMainThread(shared_ptr(), boost::bind(&HostServicesPlugin::requestCredentials,
                                                           connection));
    return;
  }

  m_host->assertMainThread();
  
  if (connection == m_viewOwner)
    return;

  if (m_viewWaitList.find(connection) != m_viewWaitlist.end())
    return;

  if (m_viewOwner == NULL)
  {
    m_viewOwner = connection;
    m_view->setLabel(connection->description());
    m_view->enable();
  }
  else
    m_viewWaitlist.push_back(connection);
}
示例#2
0
FB::JSAPIPtr WebP2P::createJSAPI() {
    // m_host is the BrowserHost
    FB::DOM::WindowPtr window = m_host->getDOMWindow();
    
    return FB::JSAPIPtr(
    	new WebP2PAPI(FB::ptr_cast<WebP2P>(shared_ptr()), m_host));
}
    LeafNodeFacePtr_t LeafNodeFace::create (const std::string& name, const osgVector3& point1, const osgVector3& point2, const osgVector3& point3, const osgVector3& point4, const osgVector4& color)
    {
        LeafNodeFacePtr_t shared_ptr(new LeafNodeFace(name, point1, point2, point3, point4, color));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
    WindowManagerPtr_t WindowManager::createCopy (WindowManagerPtr_t other)
    {
        WindowManagerPtr_t shared_ptr(new WindowManager(*other));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
    LeafNodeCapsulePtr_t LeafNodeCapsule::create (const std::string& name, const float &radius, const float &height, const osgVector4& color)
    {
        LeafNodeCapsulePtr_t shared_ptr (new LeafNodeCapsule(name, radius, height, color));

        // Add reference to itself
        shared_ptr->initWeakPtr (shared_ptr);

        return shared_ptr;
    }
示例#6
0
    NodeRodPtr_t NodeRod::createCopy(NodeRodPtr_t other)
    {
        NodeRodPtr_t shared_ptr(new NodeRod(*other));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
 LeafNodeCapsulePtr_t LeafNodeCapsule::createCopy (const LeafNodeCapsulePtr_t& other)
 {
     LeafNodeCapsulePtr_t shared_ptr (new LeafNodeCapsule(*other));
     
     // Add reference to itself
     shared_ptr->initWeakPtr (shared_ptr);
     
     return shared_ptr;
 }
    WindowManagerPtr_t WindowManager::create(osg::GraphicsContext* gc)
    {
        WindowManagerPtr_t shared_ptr(new WindowManager(gc));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
示例#9
0
    NodeRodPtr_t NodeRod::create(const std::string& name,osgVector4 color, float radius, float totalLength,short maxCapsule)
    {
        NodeRodPtr_t shared_ptr(new NodeRod(name,color,radius,totalLength,maxCapsule));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
 LeafNodeConePtr_t LeafNodeCone::createCopy (LeafNodeConePtr_t other)
 {
     LeafNodeConePtr_t shared_ptr (new LeafNodeCone(*other));
     
     // Add reference to itself
     shared_ptr->initWeakPtr (shared_ptr);
     
     return shared_ptr;
 }
 LeafNodeConePtr_t LeafNodeCone::create (const std::string& name, const float &radius, const float &height)
 {
     LeafNodeConePtr_t shared_ptr (new LeafNodeCone(name, radius, height));
     
     // Add reference to itself
     shared_ptr->initWeakPtr (shared_ptr);
     
     return shared_ptr;
 }
    WindowManagerPtr_t WindowManager::create (const unsigned int& x,
                                                            const unsigned int& y,
                                                            const unsigned int& width,
                                                            const unsigned int& height)
    {
        WindowManagerPtr_t shared_ptr(new WindowManager(x, y, width, height));

        // Add reference to itself
        shared_ptr->initWeakPtr(shared_ptr);

        return shared_ptr;
    }
void HostServicesPlugin::passwordRequestDenied()
{
  m_view.disable();

  if (!m_host->isMainThread())
  {
    m_host->ScheduleOnMainThread(shared_ptr(), boost::bind(&HostServicesPlugin::passwordRequestDenied));
    return;
  }

  m_host->assertMainThread();

  SecureConnectionPtr connection = m_viewOwner;
  handleNextCredentialsRequest();
  connection->credentialsRequestDenied();
}
示例#14
0
文件: pbdxx.cpp 项目: jabelardo/PBDxx
std::vector<element> element_array::values() const {
    size_t impl_size = size();
    size_t elements_size = elements.size();
    if (impl_size != elements_size) {
        elements.clear();
        if (impl_size > 0) {
            const pbd_element** values = pbd_element_array_values(impl);
            for (size_t i = 0; i < impl_size; ++i) {
                pbd_element* value = (pbd_element*) values[i];
                std::shared_ptr<element_base> shared_ptr(create(value, false, conf));
                elements.push_back(element(shared_ptr));
            }
        }
    }
    return elements;
}
示例#15
0
  //! Loading std::shared_ptr for polymorphic types
  template <class Archive, class T> inline
  typename std::enable_if<std::is_polymorphic<T>::value, void>::type
  load( Archive & ar, std::shared_ptr<T> & ptr )
  {
    std::uint32_t nameid;
    ar( nameid );

    // Check to see if we can skip all of this polymorphism business
    if(polymorphic_detail::serialize_wrapper(ar, ptr, nameid))
      return;

    auto binding = polymorphic_detail::getInputBinding(ar, nameid);
    std::shared_ptr<void> result;
    binding.shared_ptr(&ar, result);
    ptr = std::static_pointer_cast<T>(result);
  }
示例#16
0
文件: ntp.hpp 项目: JingSao/p2engine
		static shared_ptr create(io_service& engine_svc,const std::string& ntpServer="pool.ntp.org")
		{
			return shared_ptr(new this_type(engine_svc,ntpServer),
				shared_access_destroy<this_type>());
		}
示例#17
0
 shared_ptr shared_instance(Args... args) {
   return shared_ptr(unique_instance(std::forward<Args>(args)...).release());
 }
示例#18
0
		static shared_ptr create(io_service& engine_svc)
		{
			return shared_ptr(new this_type(engine_svc), 
				shared_access_destroy<this_type>());
		}
示例#19
0
void FB::BrowserHost::htmlLog(const std::string& str)
{
    FBLOG_INFO("BrowserHost", "Logging to HTML: " << str);
    this->ScheduleAsyncCall(&FB::BrowserHost::AsyncHtmlLog,
            new FB::AsyncLogRequest(shared_ptr(), str));
}
		static shared_ptr create(const std::string& _url, io_service& _ios)
		{
			return shared_ptr(new this_type(_url, _ios), 
				shared_access_destroy<this_type>());
		}
示例#21
0
 shared_ptr & operator=(shared_ptr const & r)
 {
     shared_ptr(r).swap(*this);
     return *this;
 }
示例#22
0
 void reset(T * p = 0)
 {
     BOOST_ASSERT(p == 0 || p != px);
     shared_ptr(p).swap(*this);
 }
示例#23
0
 shared_ptr & operator=(std::auto_ptr<T> & r)
 {
     shared_ptr(r).swap(*this);
     return *this;
 }
示例#24
0
int main() {
    shared_ptr();
    shared_ptr_container();
    weak_ptr();
    make_shared();
}