Results 1 to 3 of 3

Thread: why return false ?

  1. #1
    OrNot is offline Registered User
    Name: Bin.Li
    Organization: GE Healthcare
    Project: Enterprise solution
    Join Date
    Jun 2005
    Location
    Shanghai
    Posts
    181

    why return false ?

    hi, there

    why return false at the end of the function?

    bool
    Glacier2::RequestQueue::addRequest(const RequestPtr& request)
    {
    IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);

    assert(!_destroy);

    for(vector<RequestPtr>::iterator p = _requests.begin(); p != _requests.end(); ++p)
    {
    //
    // If the new request overrides an old one, then abort the old
    // request and replace it with the new request.
    //
    if(request->override(*p))
    {
    *p = request;
    return true;
    }
    }

    //
    // No override, we add the new request.
    //
    _requests.push_back(request);
    notify();
    return false;
    }


    why return false at the end of the function?
    Cheers
    OrNot
    ------------------------------------------
    ornot2008@yahoo.com
    --------------------------------------------

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    I'm afraid explaining the internal workings of Glacier2 on the function level is out of the scope of the support we can give here on these forums...

  3. #3
    OrNot is offline Registered User
    Name: Bin.Li
    Organization: GE Healthcare
    Project: Enterprise solution
    Join Date
    Jun 2005
    Location
    Shanghai
    Posts
    181
    hi, Marc,
    Sorry for my carelessness. I read the codes again and understand it now.
    Thanks any way.
    ------------------------------------------
    ornot2008@yahoo.com
    --------------------------------------------

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Which is the best way to do some jumps and return??
    By hulkaspeed in forum Help Center
    Replies: 8
    Last Post: 12-19-2007, 03:13 AM
  2. Expensive return by value
    By bambuk in forum Help Center
    Replies: 5
    Last Post: 06-26-2007, 09:10 AM
  3. About return struct
    By billwillman in forum Help Center
    Replies: 7
    Last Post: 10-16-2006, 02:39 AM
  4. Why does the function of checkedCast() return 0???
    By OliveGirl in forum Help Center
    Replies: 1
    Last Post: 05-25-2006, 03:52 AM
  5. return value of getPropertyAsInt
    By n2503v in forum Help Center
    Replies: 3
    Last Post: 10-19-2005, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •