Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1038189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:56:40+00:00 2026-05-16T14:56:40+00:00

I am writing a B-link tree and its attendant sub classes like a data

  • 0

I am writing a B-link tree and its attendant sub classes like a data page class and a node class etc.

I was wondering is there a way to protect the public interfaces of the nodes and pages such that only the b-link tree class itself can access them, WITHOUT simultaneously exposing the private methods of the pages and nodes to the b-link class?

IE I have already thought of simply changing the ‘public’ interface of the pages and nodes into the protected category and then declaring the B-link tree as a friend but that gives the b-link tree access to private methods that I want to stay private.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:56:40+00:00Added an answer on May 16, 2026 at 2:56 pm

    Off the top of my head, you could do something like:

    class FooAdapter;
    
    class Foo
    {
    private:
         void funcToExpose();
         void funcToHide();
         friend FooAdapter;
    };
    
    class FooAdapter
    {
    private:
         Foo foo;
         void funcToExpose() { foo.funcToExpose(); }
    
         friend SomeFriend;
    };
    

    (Not compiled or tested, but you should get the idea.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a dead link detector and wondering which lib i should use, httplib
Is there a more concise way of writing this CSS? .vertical > a:link, .vertical
I'm writing an AJAX application so every link on my page is a javascript
I'm writing something that is a bit like Facebook's shared link preview. I would
While writing documentation using Sphinx, I know that I can link to a class
I am writing a content distribution network in java. I have a Link class
I'm writing a navigation and im just wondering if its possible to keep the
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
I'm writing a web crawler and want to ignore URLs which link to binary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.